react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

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

Open Hiraqui opened this issue 6 months ago • 0 comments

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

Hiraqui avatar May 14 '25 12:05 Hiraqui