Replies: 1 comment 1 reply
-
Can you explain why you have [type]/step5 if you want to navigate to /awesomeType/step5 after step4? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hello, the community!
I'm implementing a multi-step form with submission between steps. That makes it impossible to use
Link
component for navigation between steps. I use imperativerouter.push
.I have a bunch of dynamic paths, that handle the regular path of a user, but for certain paths I want to show a custom page. For that, I added a more specific path that overlaps with the dynamic:
So when a user moves from
/[country]/[type]/step4
to the next step, I want nextjs to use more specific path/[county]/awesomeType/step5
instead of/[country]/[type]/step5
.I tried the following, none works as expected:
router.push(page, as);
with the most dynamic page. Of course, it leads to this page to be openedrouter.push(as);
, where theas
is the destination URL. It tries to request the static page from nextjs because it is considered as the page name. Then the entire page reloads and shows the target state.❓ Is there a known way to achieve the described behavior or it is considered bad practice?
Beta Was this translation helpful? Give feedback.
All reactions