-
I have a component that has a required input field, like this:
The expected output should be:
However, starting from version 7.44.0 onwards, the required attribute is being dropped from the rendered output:
The component does use native validation (I already looked at https://github.com/orgs/react-hook-form/discussions/10596)
Is there another reason why |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You need to use option Reference: https://react-hook-form.com/docs/useform/form#rules Working demo: https://codesandbox.io/s/determined-northcutt-6vwsss?file=/src/App.tsx |
Beta Was this translation helpful? Give feedback.
-
That did solve it -- I'm not exactly sure why this change is not a breaking change, however. |
Beta Was this translation helpful? Give feedback.
@louh
You need to use option
progressive=true
to pass down native validation rule attributes.Reference: https://react-hook-form.com/docs/useform/form#rules
Working demo: https://codesandbox.io/s/determined-northcutt-6vwsss?file=/src/App.tsx