react-navigation / redux-helpers

Redux middleware and utils for React Navigation
Other
296 stars 43 forks source link

Example how to implement with new API (https://github.com/react-navigation/react-navigation-redux-helpers/tree/2.0) #39

Closed mrikirill closed 6 years ago

mrikirill commented 6 years ago

Hi 👋

Is there any example about how to implement react-navigation with new API ? React-navigation docs provides the instruction only for the previous version

Ashoat commented 6 years ago

The PR to update the official React Navigation docs hasn't been merged yet. Here's the deploy preview.

mrikirill commented 6 years ago

Thanks @Ashoat Would you recommend to update right now or wait till the official React Navigation doc will updated ?

Ashoat commented 6 years ago

There was a small bug in 2.0.0, but should be fixed now. You can go ahead and update right now to 2.0.1!

mrikirill commented 6 years ago

Ok thanks @Ashoat I will update my app

ViktorAksionov commented 6 years ago

Example above doesn't work, also this

Some folks like to have their navigation state stored in the same place as the rest of their application state. Think twice before you consider doing this, there is an incredibly good chance that you do not need to do this!. Storing your React Navigation state in your own Redux store is likely to give you a very difficult time if you don't know what you're doing, and support for Redux integration is being depreacted.

is too bold statement. If you did not develop large app where you need to have strict control on each user move then without redux integration it will be easier just to abandon react-navigation and to move to other libs. Please don't be selfish person!

Ashoat commented 6 years ago

@YounetBet, I have no idea what you're talking about.

@ViktorAksionov, you're really calling open source volunteers selfish? Anyways, I didn't write that chunk. You can provide feedback on it here. For reference, the "deprecated" chunk is going away.

proutek commented 6 years ago

Updated documentation states: "4. A middleware is needed so that any events that mutate the navigation state properly trigger the event listeners. To properly trigger the event listeners with the initial state, a call to initializeListeners is also necessary."

I have updated my project according to documentation but in example there is no explicit call to initializeListeners. I assume it is done in reduxifyNavigator now.

I'm asking because I have now problems with didFocus event which is not called.

avorona commented 6 years ago

@Ashoat thanks for the link to the preview, I have needed it a couple hours ago and you had brought it in time

Ashoat commented 6 years ago

@proutek: Oops, that should be fixed! initializeListeners is deprecated in 2.0.

Ashoat commented 6 years ago

Docs are merged now.