reactjs - How can i replace screen with React Navigation for React Native -


how can replace screen react navigation react native

now i'm newbie can't understand getstateforaction have params on screen 1 , navigate screen 2 passing params username basic navigate it's nested screen 1 > 2 on stack

but need replace screen 1 screen 2 after screen 2 it's on active (replace actionconst.replace on router flux) , sending params on new way

can guide me thank you.



screen 1

  onpress = () => {            this.props.navigation.navigate('sc2', {username: this.state.username});    } 


screen 2

componentwillmount() {  const {state} = this.props.navigation; console.log(state.params.username);  } 

---------------

router

export const loginnavstack = stacknavigator({   sc1: {     screen: sc1   },   sc2: {    screen: sc2,  },  }); 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -