-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.4.4 is a Breaking Change - passing "className" this new way overwrites existing "className" in composed components #3883
Comments
This #3862 caused this problem. But I think you can make your component safer and clearer. like this const CustomInput = ({propsA, propsB}) => { return ( <div> <input type="text" className="composed-component-classname" propsA={propsA} propsB={propsB}/> </div> ); }; Probably you have written |
The above is an example for simplicity.. not actual code. 1 - A breaking change should not be put into a minor release. |
Understood, I know that's a breaking change. But I mean you can do this to improve your code health, Anyway, it's just my personal thought. if you don't like it, I'm sorry bro, You can ignore it. |
FWIW it also breaks our code (specifically field validation, where for complex fields we add the |
Also hit us. Happy we caught this with snapshottests before going live. My suggestion is also to revert this |
This is a issue for us, especially with using Also, if anyone else is wondering, this actually broke for me in 2.4.3, not 2.4.4 |
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)
Additional context
Your environment
The text was updated successfully, but these errors were encountered: