I am implementing 2 screens using react-navigation. But I got the warning below while navigating to the second page:
Warning: isMounted(...) is deprec
This is a problem with latest React Navigation and React Native. To silence it add:
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated', 'Module RCTImageLoader']);
I expect it will be fixed in React Navigation within next few weeks.
Use this statement in index.js
:
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated', 'Module RCTImageLoader']);
The answers above didn't work for me, but adding the following to index.js
did the trick:
console.ignoreYellowBox = ['Warning: isMounted(...) is deprecated'];
Or upgrade to expo 27.0.2
which basically adds the above to Expo.js
. See more information here: https://forums.expo.io/t/warnings-after-upgrade-to-expo-27/9579/10
As some of the other answers stated, it's a react-native
issue so hopefully it will be fixed soon there and then in the following version of Expo.
This is what i did for this problem for the time being:
step 1:Tap on the warning
step 2: In the yellow window click on the stack trace option in top right
step 3: Find the path where the warning has occured,ex:C:\Users\username\projectname\node_modules\react\cjs\react.development.js
step 4: Open the path in editor
step 5: Find the key word isMounted under the deprecated api's and delete the deprecated function and warning related under it.
step 6: Save and reload your app!!thats it
Ignoring this message is the wrong way for a good developer If we remove this problem then the memory leakage is decreased.
If you are using EXPO for RN development then this issue is now fixed in expo 27.0.2.
See https://forums.expo.io/t/warnings-after-upgrade-to-expo-27/9579/12