wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.04k stars 2.67k forks source link

[V2][ios] Focused searchBar results in component not unmounting #4617

Open dozoisch opened 5 years ago

dozoisch commented 5 years ago

Issue Description

I kept getting errors where it said

Exception 'Component id already exists ' was thrown while invoking push on target RNNBridgeModule with params ....

I managed to isolate it to happening only when I first focus the search bar, then pop the screen. (either by gesture or pressing back)

So I've put a log in componentWillUnmount and saw that it doesn't get called when the searchBar was focused at the moment on unmounting.

I assume that, given it's focused, the clean-up doesn't happen, which then results in componentWillUnmount not being called.

I'm more than happy to help debugging if you can point me towards where component cleanup happens when a screens is popped, but right now have no idea where that is done.

Steps to Reproduce / Code Snippets / Screenshots

  1. create a component with searchBar
topBar: {
  searchBar: usesNativeSearchBar,
  searchBarPlaceholder: "Search",
  searchBarHiddenWhenScrolling: true,
  // Same error happens without this, but it just makes it easier to repro given that it doesn't force you to un focus to go back
  hideNavBarOnFocusSearchBar: false,
},
  1. Push that component on a stack.
  2. Focus the search bar.
  3. Pop that component or go back.
  4. Try to push it again.

Environment

Work around

Way to work around it is to create a unique ID on push to make sure there are no collisions. It doesn't unmount the component any better, but at least avoids the crash. It can potentially take a lot of memory though.

dozoisch commented 5 years ago

@guyca @pqkluan Let me know if there is any information you are missing. I'm more than happy to help with anything required to fix this issue !

dozoisch commented 5 years ago

@guyca let me know if there is anything I can do to help!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

mathieumg commented 5 years ago

Not stale.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

dozoisch commented 5 years ago

Not stale

dozoisch commented 5 years ago

@guyca anything I can do to help with this :)?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

dozoisch commented 5 years ago

Not stale!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

mathieumg commented 5 years ago

Not stale

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

mathieumg commented 5 years ago

Not stale

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

mathieumg commented 5 years ago

Not stale.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

mathieumg commented 5 years ago

Not stale.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

dozoisch commented 5 years ago

Not stale

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

dozoisch commented 4 years ago

not stale :)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

dozoisch commented 4 years ago

Not stale 🎄

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

dozoisch commented 4 years ago

not stale! :)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

mathieumg commented 4 years ago

Not stale!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

dozoisch commented 4 years ago

not stale

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

dozoisch commented 4 years ago

not stale

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

dozoisch commented 4 years ago

not stale

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

dozoisch commented 4 years ago

tested on 6.0, and focusing a native search bar before backing still prevents the component from unmounting.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

dozoisch commented 4 years ago

not stale