Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isMounted is deprecated when using tab views #3021

Closed
kaym0 opened this issue May 3, 2018 · 17 comments
Closed

isMounted is deprecated when using tab views #3021

kaym0 opened this issue May 3, 2018 · 17 comments

Comments

@kaym0
Copy link

kaym0 commented May 3, 2018

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.

@ajangi
Copy link

ajangi commented May 21, 2018

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

@ajangi
Copy link

ajangi commented May 21, 2018

@kaym0 Did you found any solution?

@ajangi
Copy link

ajangi commented May 21, 2018

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

@aizain
Copy link

aizain commented May 21, 2018

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.

@ajangi
Copy link

ajangi commented May 21, 2018

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

@ajangi
Copy link

ajangi commented May 21, 2018

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

@daviscabral
Copy link
Collaborator

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.

@ajangi
Copy link

ajangi commented May 21, 2018

@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.

@daviscabral
Copy link
Collaborator

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

@xuho
Copy link

xuho commented Jun 6, 2018

I have the same issue too.

@Nigh7Sh4de
Copy link

Nigh7Sh4de commented Jun 15, 2018

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'])

facebook/react-native#18868 (comment)

@kaym0
Copy link
Author

kaym0 commented Jun 15, 2018 via email

@daviscabral
Copy link
Collaborator

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.

Alelizzt pushed a commit to Alelizzt/CrashReports that referenced this issue Jun 26, 2018
@RijaCloud
Copy link

Same issues here !

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

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

@aksonov aksonov closed this as completed Aug 8, 2018
@gaearon
Copy link

gaearon commented Sep 12, 2018

Should be fixed in 0.57.

@daviscabral
Copy link
Collaborator

Thank you sir! 👍🏻👊🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants