我有一个使用 router-flux 设置的项目,但我无法让我的场景更改工作。
如标题中所述,我尝试切换到的场景的构造函数与 componentWillMount 一样运行,但视图不会更改为下一个场景。
路线设置如下:
<Provider store={store}>
<View style={{flex: 1}}>
<Router navigationBarStyle={{backgroundColor: bs.COLOR.main2}}
titleStyle={{color: '#FFF'}}
barButtonTextStyle={{color: '#FFF'}} barButtonIconStyle={{tintColor: '#FFF'}}>
<Scene key="root">
<Scene key="startScene" title="Start" component={StartScene} hideNavBar={false} />
<Scene key="myPage" initial={true} title="My Profile"} component={MyPageScene} hideNavBar={false} />
<Scene key="profileSettings" title="My Profile" } component={ProfileSettingsScene}/>
</Scene>
</Router>
</View>
</Provider>);
并且动作被调用
<TouchableHighlight activeOpacity={0.7} underlayColor="#ffffff00" onPress={()=>Actions.profileSettings()}>...</T..
我在另一个项目中有一个类似的设置,它工作正常,我能找到的唯一区别是这段代码在一个集成的 iOS 项目中运行。我没有收到任何错误,预期的下一个场景只是没有渲染。
版本:
反应:15.3.2,反应原生:0.37.0,反应原生路由器通量:3.37.0