React-native-router-flux: How to reset history ?

Created on 12 Apr 2016  路  3Comments  路  Source: aksonov/react-native-router-flux

Version

  • react-native-router-flux v3.2.13
  • react-native v0.24.0-rc2

If i have this Scenes where the initial scene is search:

export default Actions.create(
  <Scene key="root"  titleStyle={{ fontSize: 20, fontFamily: 'Avenir-Roman', color: 'white' }} navigationBarStyle={{ backgroundColor: '#1db198', height: 80, borderBottomWidth: 0 }} >
    <Scene key="signin" component={SignIn} title="Accedi all'App" />
    <Scene key="signup" component={SignUp} title="Crea il tuo account" />
    <Scene key="checkPhone" component={CheckPhone} title="Codice di sicurezza" />
    <Scene key="search" component={Search} title="Search" initial={true} />
  </Scene>
);

but i redirect to signin scene:

class Search extends Component {

  constructor(props) {
    super(props);
  }

  componentWillMount() {
    this.checkAuth();
  }

  checkAuth(){

    if( this.props.auth_token && this.props.user_id ) {
      //Check if valid
      console.log( 'Log: ' + this.props.auth_token )
      return
    }
    Actions.signin()
  }

  render() {

    return (
      <FLayout>
        <View>
          <Text style={sharedStyle.welcome}>
            YO!
          </Text>
        </View>
      </FLayout>
    );
  }
}

If i want hide the backButton in the signin scene???How to?

Most helpful comment

Actions.signin({type: "reset"});

All 3 comments

Actions.signin({type: "reset"});

it's not the right way...
If i add 'Actions.signin({type: "reset"})' navigation does not work as it should.
After 'Actions.signin({type: "reset"})', the 'Actions.search' not work in the signin component

525

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sylvainbaronnet picture sylvainbaronnet  路  3Comments

xnog picture xnog  路  3Comments

basdvries picture basdvries  路  3Comments

YouYII picture YouYII  路  3Comments

booboothefool picture booboothefool  路  3Comments