Version Number
7.71.0
Codesandbox/Expo snack
https://github.com/joshkel/react-hook-form-bools
Steps to reproduce
- Clone the repo at https://github.com/joshkel/react-hook-form-bools.
npm i
npm test
Note the error messages (both the prop types warning and the failed submission, apparently because MUI incorrectly handles the numeric prop).
- Then retest against React Hook Form 7.70.0:
npm i react-hook-form@7.70.0
npm test
Expected behaviour
After upgrading from React Hook Form 7.70.0 to 7.71.0, our tests started logging numerous warnings similar to the following:
Warning: Failed prop type: Invalid prop disabled of type number supplied to ForwardRef(ButtonBase), expected boolean.
Some tests also started failing; presumably some of the components that we're using don't behave correctly when given numeric rather than boolean props.
This appears to be the result of #13244 (specifically, the booleans_as_integers option). I encountered it in a Jest environment that's configured to the CommonJS versions of packages. (The ESM build of react-hook-form is apparently not run through Terser.)
What browsers are you seeing the problem on?
No response
Relevant log output
Warning: Failed prop type: Invalid prop `disabled` of type `number` supplied to `ForwardRef(ButtonBase)`, expected `boolean`.
at ButtonBase (/Users/josh/src/test-cases/react-hook-form-bools/node_modules/@mui/material/ButtonBase/ButtonBase.js:90:59)
at /Users/josh/src/test-cases/react-hook-form-bools/node_modules/@emotion/react/dist/emotion-element-25f9958c.browser.cjs.js:56:23
at Button (/Users/josh/src/test-cases/react-hook-form-bools/node_modules/@mui/material/Button/Button.js:480:30)
at form
at onSubmit (/Users/josh/src/test-cases/react-hook-form-bools/form.test.js:6:23)
Code of Conduct
Version Number
7.71.0
Codesandbox/Expo snack
https://github.com/joshkel/react-hook-form-bools
Steps to reproduce
npm inpm testNote the error messages (both the prop types warning and the failed submission, apparently because MUI incorrectly handles the numeric prop).
npm i react-hook-form@7.70.0npm testExpected behaviour
After upgrading from React Hook Form 7.70.0 to 7.71.0, our tests started logging numerous warnings similar to the following:
Some tests also started failing; presumably some of the components that we're using don't behave correctly when given numeric rather than boolean props.
This appears to be the result of #13244 (specifically, the
booleans_as_integersoption). I encountered it in a Jest environment that's configured to the CommonJS versions of packages. (The ESM build of react-hook-form is apparently not run through Terser.)What browsers are you seeing the problem on?
No response
Relevant log output
Code of Conduct