RemoveEventListener error in react-native-navigation@4 #11966
-
Current behaviorI have used react-navigation: 4.4.4 in my project for the last 5 years. Expected behaviorI expect this error will be resolved. Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-04-21.at.00.10.41.mp4Reproductionhttps://github.com/gopikrishnacse55/NavigationExample Platform
Packages
Environment"@react-native-community/masked-view": "^0.1.11", |
Beta Was this translation helpful? Give feedback.
Replies: 23 comments 4 replies
-
react-navigation: 4.4.4. |
Beta Was this translation helpful? Give feedback.
-
We will check it by upgrading react-native-tab-view upgrading to 3.5.2 |
Beta Was this translation helpful? Give feedback.
-
We upgraded to react-native-tab-view:3.5.2 and the issue is still not resolved. |
Beta Was this translation helpful? Give feedback.
-
P.S. => After this version https://reactnative.dev/docs/0.70/appstate#removeeventlistener the listener is removed You guys are using the old package OLD => https://www.npmjs.com/package/react-navigation NEW => https://www.npmjs.com/package/@react-navigation/native All the new packages are under @react-navigation/* |
Beta Was this translation helpful? Give feedback.
-
Old package is working in react-native 0.68.7.Any update to fix this bug? |
Beta Was this translation helpful? Give feedback.
-
That package is deprecated and will not be maintained, you have 2 choices either upgrade the navigation to v5 (v6 has very few breaking changes) version or use the old React Native version |
Beta Was this translation helpful? Give feedback.
-
Also, you guys can try the expo router which will make the upgrade process easier, the expo router package will handle the heavy lifting of react-navigation configuration. |
Beta Was this translation helpful? Give feedback.
-
@raajnadar - Thanks for your reply. |
Beta Was this translation helpful? Give feedback.
-
I don't think the core team will fix it, it is a breaking change You can get the code of the react-navigation v4 here https://github.com/react-navigation/react-navigation/tree/4.x You can change the listener here and add it to the patch package for your use case react-navigation/packages/native/src/useLinking.native.tsx Lines 43 to 45 in d0abdee |
Beta Was this translation helpful? Give feedback.
-
@raajnadar - Thanks for your help. |
Beta Was this translation helpful? Give feedback.
-
We are using react-navigation:4.4.4 in my project. |
Beta Was this translation helpful? Give feedback.
-
Hi Team, We have successfully upgraded my project from react-native:0.68.7 to 0.73.2. |
Beta Was this translation helpful? Give feedback.
-
@gkasireddy202 unlikely react navigation 4 will be updated at this point. You are on your own with this. |
Beta Was this translation helpful? Give feedback.
-
@radko93 - How can i resolve this issue in react navigation 4? |
Beta Was this translation helpful? Give feedback.
-
@gkasireddy202 I gave you the idea, the |
Beta Was this translation helpful? Give feedback.
-
@raajnadar - I have already checked it.There are no folder packages in node_modules/react-navigation in my project |
Beta Was this translation helpful? Give feedback.
-
This is a mono repo, so all the packages under that folder will be deployed to npm as separate folders. Check you will have |
Beta Was this translation helpful? Give feedback.
-
I added the types.tsx,useLinking.native.tsx,extractPathFromURL.tsx file in react-navigation folder. |
Beta Was this translation helpful? Give feedback.
-
My team members and I saw below information about navigation 4 in the documentation 10 days ago. |
Beta Was this translation helpful? Give feedback.
-
This issue is moved to discussion from react-navigation issues. |
Beta Was this translation helpful? Give feedback.
-
You guys can try to apply this change to fix your issue temporarily P.S. - After you make the changes in the |
Beta Was this translation helpful? Give feedback.
-
@raajnadar - I create the files types.tsx,useLinking.native.tsx,extractPathFromURL.tsx under node_modules/@react-navigation/src |
Beta Was this translation helpful? Give feedback.
You guys can try to apply this change to fix your issue temporarily
08d6e14
P.S. - After you make the changes in the
node_modules
you can use the patch package. https://www.npmjs.com/package/patch-package