课程代码已对react-navigation-redux-helpers3.0做了适配:
react-navigation-redux-helpers3.0的两个变更:
1.reduxifyNavigator被改名为createReduxContainer,所以:
import {createReactNavigationReduxMiddleware, reduxifyNavigator} from 'react-navigation-redux-helpers';
//改为
import {createReactNavigationReduxMiddleware, createReduxContainer} from 'react-navigation-redux-helpers';
...
const AppWithNavigationState = reduxifyNavigator(RootNavigator, 'root');
//改为
const AppWithNavigationState = createReduxContainer(RootNavigator, 'root');
2.createReactNavigationReduxMiddleware的参数顺序发生了变化:
export const middleware = createReactNavigationReduxMiddleware(
'root',
state => state.nav
);
//改为
export const middleware = createReactNavigationReduxMiddleware(
state => state.nav,
'root'
);