-
Notifications
You must be signed in to change notification settings - Fork 51
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
Not possible to create controlled component with nil value #73
Comments
Hmm. To add more context, I don't believe that Clearly, this is too prescriptive in the general case of working with 3rd party components (or native components of other reconcilers). I'll have to think about the best way to solve this; my hunch is that we should distinguish between transforms necessary for "native" elements, and transforms necessary for DOM elements. |
After this commit, when the
:value
prop isnil
, helix would replace it withundefined
. But in react components likeinput
etc. with:value nil
is treated as a controlled component, while:value undefined
is treated as uncontrolled.This is a problem e.g. when using the
Autocomplete
component of material-ui, the:value
prop must be eithernil
or one of the values in the options list. However when I try to give it anil
, helix changes it toundefined
, which effectively make this component a uncontrolled one. Later when the user chooses a value from the auto complete list, the component would become a controlled element and cause errors.The text was updated successfully, but these errors were encountered: