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

is there any React Native support? #41

Open
Guria opened this issue Jun 21, 2019 · 1 comment
Open

is there any React Native support? #41

Guria opened this issue Jun 21, 2019 · 1 comment

Comments

@Guria
Copy link

Guria commented Jun 21, 2019

RFR had some docs on Native support. It contains some intentions to provide some updates on it, but it seems they are a bit outdated now.
Was RN support somehow transferred to rudy? Is there any usage examples?

@hedgepigdaniel
Copy link
Collaborator

I personally haven't tried it yet, but I mean to. I don't imagine there would be a huge difference vs using it with RFR though.

My recommendations (based on my experience on an app using RFR) would be:

  • use https://github.com/react-navigation/redux-helpers to dispatch redux actions in response to input handled by react-navigation. Intercept these actions in mapDispatchToProps (which are not very specific, e.g. Navigation/NAVIGATE) and redispatch them as actions matching the intended structure of your app (e.g. SETTINGS_SCREEN).
  • write your own reducer to store the navigation state for each navigator. More work, but you'll understand whats going on and you can have those nice app specific actions.
  • make sure that the navigation actions are serializable to a URL, and dispatching one of them is enough to create a valid navigation state (that way universal linking shouldn't be difficult)
  • If your app's back button does not go back through a single linear stack, do not use rudy's back functionality (which only supports a single stack). Instead, handle your concept of "back" in your own reducers, and always go "forward" as far as rudy is concerned.

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

No branches or pull requests

2 participants