navigate method vs push method #1498
-
Hello @Milad-Akarie , I wondering which are the differences between Context |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@ferrarafer I always seem to miss the threads here because the stupid Discussions tap has no counter badge. Well "navigating without context is not recommended in nested navigation unless you use navigate instead of push" is only applicable if you work with absolute paths, but I guess it's relatively old now, in recent versions auto_route can auto find the route-scope and push it to the right router. if you have a stack that looks like the following: and you push but if you navigate to and if you only push 'reviews' then you'll get the same result as using the navigate method but why would I need to use absolute paths you might think? [
/venders
:id/reviews
:id/products
:id/reviews
] let's we're on but of course this does not apply to so I guess you can safely switch to push if you're using unique |
Beta Was this translation helpful? Give feedback.
@ferrarafer I always seem to miss the threads here because the stupid Discussions tap has no counter badge.
Well "navigating without context is not recommended in nested navigation unless you use navigate instead of push" is only applicable if you work with absolute paths, but I guess it's relatively old now, in recent versions auto_route can auto find the route-scope and push it to the right router.
if you have a stack that looks like the following:
/products/12
and you push
/products/12/reviews
that's a whole new stack added to the hierarchy,but if you navigate to
/products/12/reviews
onlyreviews
will be added to already existing stackand if you only push 'reviews' then you'll get th…