[SOLVED] Navigation bug when linking two levels of NavigationLinkStore
.
#1976
oliverfoggin
started this conversation in
Beta
Replies: 1 comment 11 replies
-
You are observing the whole state WithViewStore(store, observe: { $0 }) this means if any sub state changes you redraw the whole view. In this demo when you push the third view you redraw the first view too. Navigation works by calculating what state changed. When you redraw 1, 2 should pop, because 3 is different it should be push. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Solution: Actually use the
observe
property. 👍🏻Just come across a weird navigation bug in our app and managed to create a minimal project to replicate it.
If you have two chained
NavigationLinkStore
it causes an issue on the final one.I have some code to replicate this...
LevelOne
This creates the view which just contains a link to
LevelTwo
...LevelTwo
This is pretty much identical to Level One but links to Level Three...
Level Three
This is where the bug happens.
When you navigate to
LevelThree
you will see the push happen twice and then pop back to LevelTwo.Video of the issue
Screen.Recording.2023-03-14.at.18.10.26.mov
Beta Was this translation helpful? Give feedback.
All reactions