如何使用react-native-navigation来编写redux数据流,这是我的代码。
- Navigation.registerComponent('Scan', () => props => ( <Provider
store={store}>
<ScanScreen {...props} /> </Provider> ))
你需要使用 registerComponentWithRedux 而不是从 react-native-navigation 注册组件
而且你不需要在Provider中手动封装你的组件。
请参考下面的代码段进行整合。
Navigation.registerComponentWithRedux(
"your_route_name",
() => YourScreenComponent,
Provider,
store
);
在上面的代码片段中。