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:

  1. my current navigation setup is:

    • stacknavigator
      • other scene
      • drawernavigator
        • another scene
        • tabbarnavigator
          • scenea
          • sceneb
  2. 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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -