
After using replacePath for navigation, how to carry data back to the previous page in the stack?
Read the original article:After using replacePath for navigation, how to carry data back to the previous page in the stack? After using replacePath for navigation, how to carry data back to the previous page in the stack? Requirement Description When PageA navigates to PageB using pushPath , and then PageB navigates forward again using replacePath , how can PageB pass data back to PageA when returning to it? Background Knowledge · pushPath : Pushes the specified NavDestination onto the stack. Behavior can be adjusted via NavigationOptions . · NavPathInfo : Route/page information object. · replacePath : Pops the current top of the stack and pushes the specified NavDestination . · onPop : Callback that receives a return value when a stacked page is popped. · onResult : Callback on a NavDestination that fires when the destination receives a result upon return. Implementation Steps Approach 1 — Pass a reusable **onPop** handler In PageA , define a generic onPop handler function that proces
Continue reading on Dev.to
Opens in a new tab




