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
Navigate to the project directory and install dependencies using pnpm install.
Run the tests using pnpm test && pnpm tsd.
Observe the console output for warnings.
Expected behaviour
No act() warnings should appear when unmounting inputs in useForm.
The tests should pass without any deprecation warnings or errors.
What browsers are you seeing the problem on?
No response
Relevant log output
$ pnpm test&& pnpm tsd
> react-hook-form@7.56.2 test /home/user1/dev/react-oss-dev/react-hook-form
> jest --config ./scripts/jest/jest.config.js
(node:50057) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
...
(Use `node --trace-deprecation ...` to show where the warning was created)
PASS Web src/__tests__/useForm/formState.test.tsx (5.686 s)
● Console
console.error
An update to App inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
/* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act 90 | const sub = control._subscribe({ 91 | formState: control._proxyFormState, > 92 | callback: () => updateFormState({ ...control._formState }), | ^ 93 | reRenderRoot: true, 94 | }); 95 | at node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-client.development.js:16023:19 at runWithFiberInDEV (node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-client.development.js:1522:13) at warnIfUpdatesNotWrappedWithActDEV (node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-client.development.js:16022:9) at scheduleUpdateOnFiber (node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-client.development.js:14396:11) at dispatchSetStateInternal (node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-client.development.js:6969:13) at dispatchSetState (node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-client.development.js:6927:7) at Object.updateFormState [as callback] (src/useForm.ts:92:23) at Object.callback [as next] (src/logic/createFormControl.ts:1022:17) at Object.next (src/utils/createSubject.ts:22:33) at next (src/logic/createFormControl.ts:1260:23) console.error A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components 713 | render(<App />); 714 | > 715 | fireEvent.change(screen.getByRole('textbox'), { | ^ 716 | target: { 717 | value: '123456', 718 | },...
This discussion was converted from issue #12795 on May 25, 2025 00:37.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
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
Uh oh!
There was an error while loading. Please reload this page.
-
Version Number
7.56.2
Codesandbox/Expo snack
https://codesandbox.io/p/github/yutnagase/react-hook-form
Steps to reproduce
Expected behaviour
What browsers are you seeing the problem on?
No response
Relevant log output
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions