title: How can I replace screen with React Navigation for React Native
body: <p>How can I replace screen with React Navigation for React Native</p>
  
  <p>Now I'm a newbie I can't understand about getStateForAction
  now I have params on Screen 1 and Navigate to Screen 2 with passing params username with basic Navigate it's nested screen 1 > 2 on stack</p>
  
  <p>But I need to replace screen 1 with screen 2 after screen 2 it's on active (replace like ActionConst.REPLACE on router flux) and sending params on a new way</p>
  
  <p>Can someone guide me thank you.</p>
  
  <hr>
  
  <hr>
  
  <p>screen 1</p>
  
  <pre><code>  onPress = () =&gt; {
  
            this.props.navigation.navigate('Sc2', {username: this.state.username});
  
    }
  </code></pre>
  
  <hr>
  
  <hr>
  
  <p>Screen 2 </p>
  
  <pre><code>componentWillMount() {
  
  const {state} = this.props.navigation;
  console.log(state.params.username);
  
  }
  </code></pre>
  
  <h2>---------------</h2>
  
  <p>Router</p>
  
  <pre><code>export const LoginNavStack = StackNavigator({
    Sc1: {
      screen: Sc1
    },
    Sc2: {
     screen: Sc2,
   },
  
  });
  </code></pre>