Formikで A component is changing an uncontrolled input of type text to be controlled
Feb 17, 2021 15:07 · 121 words · 1 minute read
Formik を使ったらこのエラーが出た。
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. More info: https://reactjs.org/link/controlled-components
これは操作した input#name
に initialValue
に対応する属性がなかった場合に発生した。タイポ注意。