What is differece between goBack() and pop() in router #74
-
|
The content is a same with title. I know would you explain the useCase it must use Thank you for making flowStacks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi @ibcylon, thanks for your question. You're right that So it's a matter of personal preference: if you want to verify your assumption that the current screen has been pushed, use |
Beta Was this translation helpful? Give feedback.
Hi @ibcylon, thanks for your question. You're right that
goBackwill go back to the previous screen, regardless of whether the current screen was pushed or presented. Andpopdoes the same thing, but in debug builds it will stop program execution if the current screen was presented rather than pushed. This might be useful if you want to get an early warning while developing that your assumptions about the navigation state are not correct.So it's a matter of personal preference: if you want to verify your assumption that the current screen has been pushed, use
pop; otherwise, usegoBackas it's more flexible.