You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After this commit, when the :value prop is nil, helix would replace it with undefined. But in react components like input 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 either nil or one of the values in the options list. However when I try to give it a nil, helix changes it to undefined, 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:
Hmm. To add more context, I don't believe that nil is a valid :value for most DOM elements, hence the reason that we would prefer to coerce nil to js/undefined when used with DOM elements.
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: