vantezzen / auto-form

🌟 A React component that automatically creates a @shadcn/ui form based on a zod schema.
https://vantezzen.github.io/auto-form/
2.29k stars 81 forks source link

Uncontrolled to controlled warning #7

Closed slawton3 closed 11 months ago

slawton3 commented 11 months ago

I'm getting this warning in the console. Wondering if there's a fix for this that doesn't involve controlling the field state and passing that in as a value prop? The warning is stating that the field value has an initial uncontrolled state of null or undefined and is changing to a controlled field when the value changes.

Warning: 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.

vantezzen commented 11 months ago

Fixed with https://github.com/vantezzen/auto-form/pull/9