如果我使用这样的codepush是可以的吗?
in my index.js
const RNRedux = () => (
<Provider store={store}>
<App />
</Provider>
);
AppRegistry.registerComponent(appName, () => RNRedux);
我用redux provider包装了应用组件
和在我的App组件中有很多反应导航。
App.js component looks like
</NavigationContainer>
<Stack.Screen
/>
<Stack.Screen
/>
<Stack.Screen
/>
<Stack.Screen
/>
</Stack.Navigator>
</NavigationContainer>
导出默认CodePush(codePushOptions)(App);
I'm curious if I use codepush like this? I've heard that codepush has to be wrapped top of the components
do I have to replace index.js and app.js ?
thanks for reading my question!
您需要导入index.js文件,下面是您的index.js文件的更新代码。
Index.js
const RNRedux = () => (
<Provider store={store}>
<App />
<CodePush />
</Provider>
);
AppRegistry.registerComponent(appName, () => RNRedux);
App.js
<Stack.Screen
/>
<Stack.Screen
/>
<Stack.Screen
/>
<Stack.Screen
/>
</Stack.Navigator>