react-redux-form
react-redux-form copied to clipboard
Warnings when mapping bools with mapProps
The Problem
I'm mapping touched and focus to determine if i should put a prop on my Input component. But this is results in warnings, telling me that the prop should be a string.
Steps to Reproduce
Apply mapProps
Reproducible Code Example
https://codesandbox.io/s/ol5ky04o46 check console
Do you know the fix, and would like to make a PR?
Hello @davidkpiano,
Did some digging, and it would seem that this is enforced by react. Adding touched={ false } to a vanilla input field will yield the same result.
So i'm a bit unsure how to handle this, i could convert forth and back in my own application. Or this could be handled by react-redux-form, i would assume by casting certain boolean values to string, that react actually render to the dom. Could be somewhere in here https://github.com/davidkpiano/react-redux-form/blob/master/src/components/control-component-factory.js#L229.
I would love to make a pull request, if that is desired road. But would love some input.
Thank you :-).