-
Notifications
You must be signed in to change notification settings - Fork 45
Support for react-native-navigation? #13
Comments
Hi, that's a very good question! I haven't gotten around to test this, but my initial guess would be that this would indeed be possible. Assuming that react-native-magic-move can properly measure the elements, and can draw in front of the RNN screens, it should work. So to sumarize
At the moment this has no priority for me as I don't use it myself, and RNN supports shared element transitions on its own. PR's and investigative work are very welcome though |
I have a snack with this working using react-native-magic-move + react-navigation: https://snack.expo.io/@alexfoxy/473def The only problem is that when going back, or navigating to the previous scene the animation doesn't reverse. @IjzerenHein Am I doing something wrong? |
Sweet! That's probably because it now works when a new component is mounted. In order to make that work you'll need to control the |
Spent some time looking into this. It appears that the main issue is that So, even if we register our screens as so, they still won't share their Navigation.registerComponent(
'ScreenExample',
() => (props) => (
<MagicMove.Provider>
<ScreenExample {...props} />
</MagicMove.Provider>
),
() => ScreenExample,
); A potentially simple workaround is to allow for exporting the shared value, like redux does. So that we can pass it explicitly via |
Will this library work with react-native-navigation considering that each screen is it's own react root?
The text was updated successfully, but these errors were encountered: