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?
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
Komentar yang paling membantu
Actions.signin({type: "reset"});