React navigation -
i have 2 screens linked via tabbarnavigator
:
screena: upon pressing button, trigger function this.props.navigation.navigate('screenb', {data: 'test'}
whereupon {data: 'test'}
params
.
screenb: navigation page works expected. however, unable access params object - though can see in navigation dispatch log in console.
i've looked @ react-navigation api, on link navigation props no avail. suggestions on how can programmatically access params
on screenb?
edits:
my current navigation setup is:
- stacknavigator
- other scene
- drawernavigator
- another scene
- tabbarnavigator
- scenea
- sceneb
- stacknavigator
when on sceneb, output of
console.log(this.props.navigation.state)
{key: "sceneb", routename: "sceneb"}
.
in screenb
component, should able access params
passed using this.props.navigation.state.params
. kinda long, huh?
so in case can do:
console.log(this.props.navigation.state.params.data
, see test
!
Comments
Post a Comment