Skip to content

Sorting arrays not working in Nextjs 15.3 while using viewTransition experimental feature #4622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Hiraqui opened this issue May 14, 2025 · 0 comments

Comments

@Hiraqui
Copy link

Hiraqui commented May 14, 2025

Just wanted to report this issue because I spent a day trying to figure out why my implementation was not working correctly.

I was trying to implement a simple array form with shadcn and was having issues with the sorting.

Finally realized it was due to Nextjs' viewTransition experimental feature. Once I turned it off, the form and sorting was working as expected.

I found this issue on nextjs github and apparently is happening in general with sorting. They think it's because of React and not them. Definitely is not a bug of this lib.

I just reported my findings there and wanted to do it here as well in case you want to mention it on the documentation, or at least people may find it while having the same issue. One solution could be to roll back to nextjs v15.2.0

In nextjs v15.2.0 the transitions are working and the reorder as well, this started happening after v15.3.

Here's a repro with canary (same result with ^15.3):
https://codesandbox.io/p/devbox/serene-hypatia-4xhp8s

And here is the working code where I only changed nextjs version to 15.2.0
https://codesandbox.io/p/devbox/json-schema-bug-forked-wd437y?workspaceId=ws_F4Ucu8TTaRzzm76X1xr7Se

@github-actions github-actions bot added the needs triage Initial label given, to be assigned correct labels and assigned label May 14, 2025
@Hiraqui Hiraqui changed the title Sorting in arrays not working in Nextjs 15.3 while using viewTransition experimental feature Sorting arrays not working in Nextjs 15.3 while using viewTransition experimental feature May 14, 2025
@heath-freenome heath-freenome added announcement and removed needs triage Initial label given, to be assigned correct labels and assigned labels May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants