Open
Description
Bug report
Current Behavior
2.4.4 unexpectedly broke all of my fields.
The way the code is implemented, className becomes required and overwrites all my classNames that exist on my composed components being passed into <Field component={MyCustomComponent} />
Expected behavior
className does not become a required prop
Reproducible example
const CustomInput = (props) => { return ( <div> <input type="text" className="composed-component-classname" {...props} /> </div> ); };
<Field name="name" component={CustomInput} />
Suggested solution(s)
- Revert this change. Passing "className" was already supported via ...rest props and a component that either spreads/or specifically requires any specific props to be passed.
Additional context
- passing className after the ...rest in the formik lib will overwrite any existing className prop already on the input
Your environment
Software | Version(s) |
---|---|
Formik | 2.4.4 |
React | 18.2.0 |
TypeScript | N.A. |
Browser | Any |
Yarn | 1.22.19 |
Operating System | macOS 13.5.1 (Ventura) |
Activity