Next.js Discord

Discord Forum

router.replace option shallow

Unanswered
Serengeti posted this in #help-forum
Open in Discord
Avatar
SerengetiOP
the shallow option only doesn't allow the triggers: getStaticProps, getServerSideProps or getInitialProps.
Is there a way to only change the url but to NOT alter the page nor rerender?

3 Replies

Avatar
Peterbald
Have you found the solution?
Avatar
Boreal Chickadee
joining
Avatar
risky
can you try this window.history.replaceState on client side maybe - i think it should work for not just query params: https://nextjs.org/blog/next-14-1#windowhistorypushstate-and-windowhistoryreplacestate (or do you mean on server change the url?)