Reputation:
I have a tabnavigator like so
var TabNavigation = createBottomTabNavigator({
NearbyScreen: {
screen: Nearby
},
FindScreen:{
screen: LandmarkNavigation
},
NotificationScreen:{
screen: Notifications
},
MyProfile:{
screen: MyProfile
}
})
that is rendered in the component
render() {
//console.log(this.props);
var nearbyLocations = this.props.locationsNearby;
return(
<TabNavigation thisThing="thisThingValue" />
)
}
How do I access the value of the prop I passed on inside one of it's tabs?
Upvotes: 1
Views: 1245
Reputation:
I solved it with screenProps:
return(
<TabNavigation screenProps={thing} />
)
Which made it accessible in the navigator tab view via this.props.screenProps
Upvotes: 1
Reputation: 1586
Try accessing through here this.props.navigation.state.params.thisThing
Upvotes: 0