【发布时间】:2018-06-18 23:28:46
【问题描述】:
TabNavigator 中有 2 个 StackNavigator 对象,其中的屏幕很少。如何从 App.js -> TabNavigator -> 每个 StackNavigator -> screen 传递道具?
下面的代码会产生错误,说只能渲染一个路由器。
const SettingsStack = createStackNavigator({
Settings: {screen: props => <SettingsScreen {...props} screenProps={{is_authenticated: props.is_authenticated}}/> },
Profile: {screen: ProfileScreen},
});
const MainTabNavigator = createBottomTabNavigator({
SettingsStack: {screen: props => <SettingsStack {...props} screenProps={{is_authenticated: props.is_authenticated}}/>},
})
【问题讨论】:
标签: react-native react-navigation