注意注意:使用了react-navigation-redux-helpers3.0的同学请注意!!!

来源:6-

CrazyCodeBoy

2019-02-19

课程代码已对react-navigation-redux-helpers3.0做了适配:

  • 24212eb835 - Keep react navigation new and react-navigation-redux-helpe : 此次更新适配了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'
);
写回答

1回答

CrazyCodeBoy

提问者

2019-02-19

2
0

RN入门到进阶,打造高质量上线App

解锁React Native开发应用新姿势,React Native新版本热门技术

3144 学习 · 3241 问题

查看课程