react-router icon indicating copy to clipboard operation
react-router copied to clipboard

[Bug]: Replace deprecated `Linking.removeEventListener()` in react-router-native

Open alexstock1 opened this issue 2 years ago • 1 comments

What version of React Router are you using?

6.16.0

Steps to Reproduce

if you will run 6.16.0 react router native on react native 0.72.3 you will get this error

Warning: Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

TypeError: _reactNative.Linking.removeEventListener is not a function (it is undefined)

Expected Behavior

this error should not be present, this is what we have in the source code:

{Linking.removeEventListener(URLEventType,handleURLChange);};}

this should be removed since this method is not present in react native any more

Actual Behavior

failed with error

alexstock1 avatar Oct 04 '23 08:10 alexstock1

Can you submit a PR to fix this?

Here's the relevant deprecation note: https://github.com/facebook/react-native/blob/main/CHANGELOG-pre-070.md#deprecated-2

timdorr avatar Oct 04 '23 14:10 timdorr