Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt RNRF for latest React Navigation (v2+) #3068

Closed
aksonov opened this issue Jun 6, 2018 · 14 comments
Closed

Adopt RNRF for latest React Navigation (v2+) #3068

aksonov opened this issue Jun 6, 2018 · 14 comments

Comments

@aksonov
Copy link
Owner

aksonov commented Jun 6, 2018

Current 4.0.0-beta.31 depends from react-navigation 1.5.6. It would be great to migrate to latest v2. createNavigator API is changed and some other breaking changes were made..

@daviscabral
Copy link
Collaborator

I have this partially done - when finished I can push a PR and reference it here.

@gyf19
Copy link

gyf19 commented Jun 6, 2018

I want to know what version of react-native is required after the upgrade?

@daviscabral
Copy link
Collaborator

@gyf19 I'll confirm it as soon as I get back to contribute here - probably end of next week. Thank you.

@AlexDM0
Copy link

AlexDM0 commented Jul 2, 2018

I'm really looking forward to an integration with the new versions since the following bug is very visible in our app: react-navigation/react-navigation#4185

It's fixed in 2.5.5 :)

@aksonov
Copy link
Owner Author

aksonov commented Jul 9, 2018

Unfortunately it seems to be quite hard... I started and stuck here: react-navigation/react-navigation#4481

As you can see react-navigation starts recommending to store state within their library only and will not support (?) external management of state with Redux, MobX, etc. (as well as RNRF), etc. starting next major version. I will think what I can do.

@aksonov
Copy link
Owner Author

aksonov commented Jul 22, 2018

I found one easy and one complex way. First is to remove state management from RNRF, second is to build own navigators and use them instead of react-navigation ones, use only views from react-navigation. I'm working on first way while probably second way may be implemented at the future (or maybe not).

Feel free to check my PR (Some links work, some not - login/lightbox/modal don't work yet)

@aksonov
Copy link
Owner Author

aksonov commented Jul 22, 2018

@daviscabral what do you think about my comments above and my PR? There are still a lot of things to to do, maybe you can help here (new tab navigator, our custom actions like popTo, etc)....

@daviscabral
Copy link
Collaborator

@aksonov Great - I've been thinking about removing state management from RNRF - but that would make the project name a bit out of sync with it. I'll check your PR and start to hack on missing stuff - let me know things that you would prefer me to look into first.

@aksonov
Copy link
Owner Author

aksonov commented Jul 22, 2018

@daviscabral Could you clarify - "make the project name a bit out of sync with it." ? RNRF name?
You may start from converting Modal/Overlay/Lightbox navigators and restore original Example demo, fix eslint errors or restore original actions like POP_TO, checking all other actions like RESET, REPLACE - they may not work..., etc.

@daviscabral
Copy link
Collaborator

@aksonov sure - yeah - when I was trying to make it to work with react-navigation@2 here - ended being more like a utils than something like it is now. But checking your PR, that's a way better than I thought.

I have created a few helpers/utils for some projects where I am using react-navigation@2 that I think might be useful there. I'll get started with it tonight! 👍

@aksonov
Copy link
Owner Author

aksonov commented Jul 22, 2018

@daviscabral Great! Also we can remove mobx now too to make RNRF more lightweight (everybody who are observing state/or currentScene will be able to pass own onNavigationState function)

@daviscabral
Copy link
Collaborator

@aksonov I can do it - even provide the way to connect it with onNavigationState.

Also - with the new React context API - we might want to explore that instead of a forward props hell that usually happens.

daviscabral added a commit to daviscabral/react-native-router-flux that referenced this issue Jul 23, 2018
* react-navigation-v2:
  use WIP RNRF for Example
  revert RN to 0.55.4
  upgrade Example to RN0.56
  WIP: migration to react-navigation v2.x (aksonov#3068)
daviscabral added a commit to daviscabral/react-native-router-flux that referenced this issue Jul 26, 2018
…e-action

* react-navigation-v2:
  small tweaks
  bump version
  introduce onStateChange handler to be used instead of createReducer
  fix navTransparent
  add onEnter/onExit handlers and automatic transitions
  fix eslint
  fix error
  more eslint fixes
  fix eslint errors
  fix error
  fix eslint
  fix custom navigators
  Babel v7, ESlint fixes, React/React Navigation upgrades, mobx removed (aksonov#3142)
  use WIP RNRF for Example
  revert RN to 0.55.4
  upgrade Example to RN0.56
  WIP: migration to react-navigation v2.x (aksonov#3068)
aksonov added a commit that referenced this issue Aug 8, 2018
migration to react-navigation v2.x (#3068)
@aksonov
Copy link
Owner Author

aksonov commented Aug 8, 2018

Please check latest 4.0.0-beta.40, it uses React Navigation v2.x now

@aksonov aksonov closed this as completed Aug 8, 2018
@AlexDM0
Copy link

AlexDM0 commented Oct 9, 2018

There's quite the annoying bug in 2.x of RNavigation, did anyone find a workaround?

react-navigation/react-navigation#4884

Unfortunately, I'm still stuck in the beta's because of it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants