You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I’m having this issue in a project I’m working on and I’m hoping someone can help me out.
Project uses React+shadcn+react-query. I have form with two fields.
The very first time fieldOne changes, I get a console warning:
Warning: Cannot update a component (`MyComponent`) while rendering a different component (`Controller`). To locate the bad setState() call inside `Controller`, follow the ...
The form works, but this warning really bothers me. At first I had all code in one component and it worked, now I refactored and get an error.
I tried replicating the issue with just react-hook-form (sandbox), but I couldn't replicate console warning.
What could I do better here? TYIA
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello! I’m having this issue in a project I’m working on and I’m hoping someone can help me out.
Project uses React+shadcn+react-query. I have form with two fields.
Field two depends on field one - if field one changes, a http request is made inside field two that is enabled only when
fieldOne
has a value:The very first time
fieldOne
changes, I get a console warning:The form works, but this warning really bothers me. At first I had all code in one component and it worked, now I refactored and get an error.
I tried replicating the issue with just react-hook-form (sandbox), but I couldn't replicate console warning.
What could I do better here? TYIA
Beta Was this translation helpful? Give feedback.
All reactions