vercel / next.js

The React Framework
https://nextjs.org
MIT License
121.29k stars 25.96k forks source link

Support history state in Next.js router #65269

Closed alanhamlett closed 2 weeks ago

alanhamlett commented 2 weeks ago

What is the update you wish to see?

Using app router, we can no longer push state to the next page when navigating. This is a feature depended on by many modern web apps, and IMO should be added back to the Next.js router.

https://github.com/vercel/next.js/pull/58335 tried to solve it by monkeypatching window.history.pushState, but that's error prone and the wrong solution.

Currently the only solution app devs are left with is forking next's router to allow pushing state.

Is there any context that might help us understand?

https://github.com/vercel/next.js/pull/58335#issuecomment-1846134361

Does the docs page already exist? Please link to it.

No response

alanhamlett commented 2 weeks ago

Closing in favor of this discussion.

timneutkens commented 2 weeks ago

https://github.com/vercel/next.js/discussions/35654#discussioncomment-9294232

github-actions[bot] commented 1 day ago

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.