Navigation from /category/gaming to /userName/list123 without refreshing the page
Unanswered
Mallow bee posted this in #help-forum
Mallow beeOP
Hi, I have a dynamic category route as followed:
Within each category, there are posts created by different users.
When clicking each post, a modal is opened with its content and now I want it to change to the following URL format:
How can I do that without a page reload?
I'm using next/link but when the url changes it automatically redirects the user.
example.com/category/gamingexample.com/category/fashionWithin each category, there are posts created by different users.
When clicking each post, a modal is opened with its content and now I want it to change to the following URL format:
example.com/userName/somePostexample.com/anotherUser/anotherPost123How can I do that without a page reload?
I'm using next/link but when the url changes it automatically redirects the user.
5 Replies
I think you should take a look at useTransition hook of react
I'm not sure if i got your problem but maybe it can be helpful
Mallow beeOP
I looked into that, but it doesn't solve the problem
I'm sharing this simpler example of my
This link opens a login modal.
When I'm in
But when I'm in
I'm sharing this simpler example of my
Header component - <Link href="/" as="/login">
<Button variant="default" size="lg">
Sign in
</Button>
</Link>This link opens a login modal.
When I'm in
/ it works - the modal opens and no redirection happen.But when I'm in
/category/example i'm being redirected to /loginin that link component u have an href so it s normal actually
why you use link element to open a modal?