Modal routes as alternative for intercepting/parallel routes #61465
Unanswered
Enkratia
asked this question in
Show and tell
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.
-
I have made simple alternative for intercepting/parallel routes.
Maybe it will be helpful for someone else.
Because:
revalidatePath()
crashes app in many cases (when you using intercepting/parallel routes.)router.refresh()
freezes app (when you using intercepting/parallel routes.)(modal)
breaks router #51714Drawbacks:
next-auth
)Advantages:
revalidatePath()
/revalidateTag()
/ androuter.refresh()
are working as expected.Demo (53 seconds)
https://youtu.be/uIOj25V7N9Y
In all this code you just need to change variables and links to the 'modal pages'.
Structure of folders the same as for the parallel routes, but instead of
@modalAuth
i use_modalAuth
.middleware.ts
commonHelper.tsx (you can put this component inside 'body' tag)
actions.ts
Beta Was this translation helpful? Give feedback.
All reactions