Description
Describe the Bug
After upgrade to 3.37.0, when you visit a collection that has array or group and refresh the page, it will spamming multiple lines of warning in the console.
Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().
Link to the code that reproduces this issue
https://github.com/anyuj/flooded-warnings
Reproduction Steps
Use the above repo or:
- Init a payload blank template
- Create collection either with array or group
- Visit the collection page, and refresh the page. The warnings will show up.
Which area(s) are affected? (Select all that apply)
Any collection that has either a group or an array field
Environment Info
Payload: 3.37.0
Next.js: 15.3.2
Node: 22.13.0