Skip to content

[Bug] Todo - Move First to End - Warning: Cannot update a component (ForwardRef) while rendering a different component (Field) #193

@awhitford

Description

@awhitford

Steps to Reproduce

  1. Run the React Playground
  2. Open the Chrome Developer Tools to see the JavaScript Console
  3. Choose the Todos tab
  4. Click Move first to end

Check the JavaScript Console and you will see an error like:

react-dom_client.js?v=d064dc83:521 Warning: Cannot update a component (`ForwardRef`) while rendering a different component (`Field`). To locate the bad setState() call inside `Field`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render
    at Field (http://localhost:5173/@fs/Users/anthony/github/awhitford/modular-forms/packages/react/dist/index.mjs:91:27)
    at div
    at div
    at div
    at div
    at FieldArray (http://localhost:5173/@fs/Users/anthony/github/awhitford/modular-forms/packages/react/dist/index.mjs:92:32)
    at div
    at form
    at Form
    at TodosPage (http://localhost:5173/src/routes/todos.tsx:35:8)
    at RenderedRoute (http://localhost:5173/node_modules/.vite/deps/react-router-dom.js?v=d064dc83:3265:5)
    at Routes (http://localhost:5173/node_modules/.vite/deps/react-router-dom.js?v=d064dc83:3718:5)
    at main
    at Router (http://localhost:5173/node_modules/.vite/deps/react-router-dom.js?v=d064dc83:3665:15)
    at BrowserRouter (http://localhost:5173/node_modules/.vite/deps/react-router-dom.js?v=d064dc83:4132:5)
    at App

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions