react-navigation / redux-helpers

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

Add navigation reducer #5

Closed yordis closed 6 years ago

yordis commented 6 years ago

@brentvatne @Ashoat here is why.

import { StackNavigator } from "react-navigation";
export const RootNavigator = StackNavigator(
  // ...
);
// ./src/redux/reducers/navigation.js

import { createNavigationReducer } from "react-navigation-redux-helpers";
import { RootNavigator } from "../path/to/your/navigator-component";

export const navReducer = createNavigationReducer(RootNavigator);

This way we remove some boilerplate from the Redux documentation and it is agnostic of the application because we pass the navigator component down.

Check the @TODO I need your help on it.

yordis commented 6 years ago

@Ashoat ready to be merged.

yordis commented 6 years ago

@Ashoat any updates on this one?

Ashoat commented 6 years ago

I've published react-navigation-redux-helpers@1.0.2 which includes this PR.