Open arackaf opened 1 month ago
the inserted history object must meet the internal requirements of next.js (next.js internally determines whether the history is "valid" or not by using the N field) [N](https://github.com/vercel/next.js/blob/6b6590592eb95990cae768c099002d2b45359dbb/packages/next/src/shared/lib/router/router.ts#L929)
You can bypass the restrictions inside next.js by adding __N: true to the history state object, but I don't recommend it. You should use next/router to control the routing
the inserted history object must meet the internal requirements of next.js (next.js internally determines whether the history is "valid" or not by using the N field) [N](https://github.com/vercel/next.js/blob/6b6590592eb95990cae768c099002d2b45359dbb/packages/next/src/shared/lib/router/router.ts#L929)
You can bypass the restrictions inside next.js by adding __N: true to the history state object, but I don't recommend it. You should use next/router to control the routing
14.1 release blog post mentions window.history.pushState
and window.history.replaceState
being supported by App Router https://nextjs.org/blog/next-14-1#windowhistorypushstate-and-windowhistoryreplacestate
One would expect this to work then, right? Judging by that blog post.
Link to the code that reproduces this issue
https://github.com/arackaf/react-query-rsc-blog-post/blob/special/push-state-with-transition/src/app/components/BookSearchForm.tsx#L23
To Reproduce
Run app Browse to http://localhost:3000/react-query Type "the" in the search box and hit enter
Current vs. Expected behavior
The transition is not respect, and the component suspends to the nearest Suspense boundary
Provide environment information
Which area(s) are affected? (Select all that apply)
Navigation
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed)
Additional context
This is a crucial feature for shallow routing. I hope it sees its way in, soon! 🙏