Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
329 views
in Technique[技术] by (71.8m points)

React navigation 5.x after login redirect on a specific screen

I am working on a hotel booking app where I have to apply a condition, on the time of hotel booking if a user is not loggedIn, there will be a button login to book, when the user will click on a button it will redirect to the login screen after login, I want it should be redirected on same hotel booking screen, but right now after login it redirects to the home screen. Please guide me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

When User click the Button it will redirect to the login screen...Then Your can Pass a Props value like this.props.navigation.navigate('login',{BackTopage:"bookingpage"})

Now When click login Button just check the Props Using If condition if(this.props.navigation.state.params .BackTopage == 'bookingpage'){ this.props.navigation.navigate('BookingPage') }


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...