State based navigation 2 #1434
Unanswered
JaapWijnen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Recently discussed state based navigation in #1398
I have a slightly more complex example however in which a similar problem is popping up. Hoping to get some tips on how to avoid/fix this!
Quick overview of the structure:
AListView
that contains an array ofA.State
. The view itself renders a list ofACardView
s card state is contained withinA.State
C.State
BView
BView
orCView
depending on the state of thecWorks
toggle in ACard.StateCView
regardless of ifACard.State.cWorks
is true.Problem: When I press the B button I navigate to the
BView
for that entity ofA.State
, when I press the "Button to C" I run into the issue that navigation seems to re render/trigger and it ends up in theBView
instead ofCView
.Help would be very much appreciated! (I suspect the issue is due to the state in the Route Enum changing when showC is set to true this in turn updates
AList.State.route
which re triggers the navigation link. Not sure how to work around that however!If anything is unclear please let me know.
Here's some example code:
Beta Was this translation helpful? Give feedback.
All reactions