react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[NavigatorIOS] how to catch the moment that view switch event done

Open nosensezzz opened this issue 11 years ago • 3 comments

I ran into a issue when I use the NavigatorIOS component.

after user click a button, it start a ajax call, during the ajax call, user could click the button but it won't do anything because I set a loading parameter to prevent it, after ajax call done, I switch the view by push new viewmodel into NavigatorIOS array, and the page will switch to the new page, issue happens here, because I set loading to false after I the navigatorios.push function, there is a very short moment pages are switch but the loading parameter already been set to false, so if user click the button during the page switch animation happening, it will push two page to the NavigatorIOS array.

I am thinking use settimeout to handle this issue, but I feel it very unprofessional, do you guys have any good method to handle this situation?

nosensezzz avatar Sep 07 '15 02:09 nosensezzz

Please read this documentation: https://facebook.github.io/react-native/docs/navigator-comparison.html#content

I highly recommend using Navigator instead. This functionality is not built into NavigatorIOS and that component is not maintained by the team at Facebook or any core contributors :(

brentvatne avatar Sep 07 '15 04:09 brentvatne

@facebook-github-bot answered

mkonicek avatar Mar 16 '16 12:03 mkonicek

Closing this issue as @mkonicek says the question asked has been answered. Please help us by asking questions on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

facebook-github-bot avatar Mar 16 '16 12:03 facebook-github-bot