React-native-router-flux: Bagaimana cara mengatur ulang riwayat?

Dibuat pada 12 Apr 2016  ·  3Komentar  ·  Sumber: aksonov/react-native-router-flux

Versi: kapan

  • reaksi-asli-router-flux v3.2.13
  • reaksi asli v0.24.0-rc2

Jika saya memiliki Adegan ini di mana adegan awal adalah pencarian:

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>
);

tetapi saya mengarahkan ulang ke adegan masuk:

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>
    );
  }
}

Jika saya ingin menyembunyikan tombol kembali di adegan masuk???Bagaimana caranya?

Komentar yang paling membantu

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

Semua 3 komentar

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

itu bukan cara yang benar...
Jika saya menambahkan navigasi 'Actions.signin({type: "reset"})' tidak berfungsi sebagaimana mestinya.
Setelah 'Actions.signin({type: "reset"})', 'Actions.search' tidak berfungsi di komponen masuk

525

Apakah halaman ini membantu?
0 / 5 - 0 peringkat

Masalah terkait

rafaelcorreiapoli picture rafaelcorreiapoli  ·  3Komentar

luco picture luco  ·  3Komentar

willmcclellan picture willmcclellan  ·  3Komentar

maphongba008 picture maphongba008  ·  3Komentar

jgibbons picture jgibbons  ·  3Komentar