【发布时间】:2017-10-20 03:03:23
【问题描述】:
我正在使用光滑的 React Navigation 并在此处关注 nested navigation recipe,但我不知道如何将“this”传递给我的导航。对不起,我的无知。
这是我的总体结构大纲:
class MyApp extends Component {
render() {
return (
<StackNavigation
screenProps={this.state}
/>
)
}
}
const MainScreenNavigator = TabNavigator(
{
Awesome: { screen: Awesome } // How do I pass this.state?
}
)
const routesConfig = {
Home: { screen: MainScreenNavigator },
Profile: { screen: Profile }
}
const StackNavigation = StackNavigator(routesConfig, {initialRouteName: 'Home'})
那么如何将 this.state 传递给我的 MainScreenNavigator?
【问题讨论】:
标签: reactjs react-native ecmascript-6 react-navigation