You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have two different routes that are different lengths that descend from the same parent node:
[ "foo", "bar1", "baz" ]
[ "foo", "bar2" ]
And I have four different Routable objects:
foo
bar1
bar2
baz
where "foo" is the parent Routable of "bar1" and "bar2", and "baz" is a child routable of "bar1".
When I make the transition between the two routes, it would make sense to me that "bar1" would be sent a pop-action to remove "baz", but why should "foo" also be sent a pop-action to remove "bar1" and then be sent a separate push-action to add back "bar2"? Since they share the same common parent in "foo", shouldn't "foo" get sent a change-action to exchange "bar1" with "bar2"?
Right now the behavior defining this is from the following rule:
The old route had an element after the commonSubroute and the new route does not we need to pop the route segment after the commonSubroute
And it means that everything descending from "foo", because the routes are different lengths, is first popped off and then pushed back on, rather than popping off the non-common elements but doing a change-action for the most senior child element that is not in the common subroute.
Is this default behavior something that should possibly be modified?
The text was updated successfully, but these errors were encountered:
I think it is a bug, the change action should be called when the routes are
old --> [ "foo", "bar1", "baz" ]
new --> [ "foo", "bar2" ]
the transistion between bar1 to bar2
kmmraj
added a commit
to kmmraj/ReSwift-Router
that referenced
this issue
Jul 11, 2019
Let's say I have two different routes that are different lengths that descend from the same parent node:
[ "foo", "bar1", "baz" ]
[ "foo", "bar2" ]
And I have four different Routable objects:
where "foo" is the parent Routable of "bar1" and "bar2", and "baz" is a child routable of "bar1".
When I make the transition between the two routes, it would make sense to me that "bar1" would be sent a pop-action to remove "baz", but why should "foo" also be sent a pop-action to remove "bar1" and then be sent a separate push-action to add back "bar2"? Since they share the same common parent in "foo", shouldn't "foo" get sent a change-action to exchange "bar1" with "bar2"?
Right now the behavior defining this is from the following rule:
And it means that everything descending from "foo", because the routes are different lengths, is first popped off and then pushed back on, rather than popping off the non-common elements but doing a change-action for the most senior child element that is not in the common subroute.
Is this default behavior something that should possibly be modified?
The text was updated successfully, but these errors were encountered: