React-native-router-flux: isMounted is deprecated when using tab views

Created on 3 May 2018  ·  17Comments  ·  Source: aksonov/react-native-router-flux

I get this whenever I go into my tabbed scene ever since I added it. If I view the two components separately they work fine, it's adding the tabs which cause it to break. I've tried various things like unmountScene={true} (pretty sure it doesn't do anything)

Should I mute this error, because everything seems to work okay. I'm just wondering if there is something I'm doing wrong, or if this is an actual issue with the package.

    "react-native-router-flux": "^4.0.0-beta.28",
    "react-navigation": "^1.5.11",
const AppRouter = () => {
    return (
        <Router>
            <Modal key="modal">
                <Stack key="root" hideNavBar > 
                    <Drawer key="Drawer" hideNavBar contentComponent={Sidebar} drawerWidth={deviceWidth/1.38}>
                        <Stack key="MainStack" navBar={Layout} >
                            <Scene key="Main" component={Main} />
                            <Scene key="Settings" component={Settings}/>    
                            <Scene key="TVInfo" component={TVInfo}/>
                            <Scene key="Login" component={Login} />           
                            <Scene key="TabBar" tabs={true} hideTabBar={false}>
                                <Scene key="Info" hideNavBar={true} title="Info" icon={TabIcon} component={MovieInfo} />
                                <Scene key="Cast" hideNavBar={true}  title="Cast" icon={TabIcon} component={Cast} />
                            </Scene>
                        </Stack>
                    </Drawer>
                </Stack>    
            </Modal>
        </Router>
    )
}

Sorry for formatting, Markup seems to take my two space tabs as if they were like 4 or 5 spaces.

help wanted

Most helpful comment

Btw, hide the warning is not a solution. I don't consider a warning a blocker in a release, just a heads-up about possible out of date packages and future unsupported code.

All 17 comments

Guys, I have the same issue! How can we fix it?

@kaym0 Did you found any solution?

@januswel @andrew @daviscabral @joenoon Is there any solution for this guys?

Warning: isMounted(...) is deprecated in plain JavaScript React classes. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.

@guangyuzhihun What do you mean bro? Is there any solutions for this issue? did you fixed it?

@aksonov How can I solve this issue dear Pavel?
Thanks!

That's not an error - it is a warning. Even a few official packages still make references to isMounted yet.

By the way, this is not even used by react-native-router-flux anywhere. I believe that react-navigation is the culprit here.

@daviscabral Thanks buddy.
But I don't wanna ignore the warning and want to solve it. The warning says that it might cause memory leakage.

That's fine. Please provide a pull-request with your solution.

I have the same issue too.

This may be coming from within react-native itself. You can add the following to get rid of the warning until version 0.56 lands.

import { YellowBox } from 'react-native'
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated'])

https://github.com/facebook/react-native/issues/18868#issuecomment-396631905

Yes, out now I will post what had to be changed once I get home.

On Mon, May 21, 2018, 03:51 Alireza Jangi notifications@github.com wrote:

@kaym0 https://github.com/kaym0 Did you found any solution?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/aksonov/react-native-router-flux/issues/3021#issuecomment-390564023,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AS02m8KmQAhgTvTmGVQJJXIog4p890Ovks5t0lz2gaJpZM4TxuyX
.

Btw, hide the warning is not a solution. I don't consider a warning a blocker in a release, just a heads-up about possible out of date packages and future unsupported code.

Same issues here !

Please try to reproduce it with Example project and latest version 4.0.0-beta.40 (and RN0.56). Feel free to open if the issue still exists

Should be fixed in 0.57.

Thank you sir! 👍🏻👊🏻

Was this page helpful?
0 / 5 - 0 ratings

Related issues

basdvries picture basdvries  ·  3Comments

vinayr picture vinayr  ·  3Comments

fgrs picture fgrs  ·  3Comments

sarovin picture sarovin  ·  3Comments

willmcclellan picture willmcclellan  ·  3Comments