Issue with react v15 - uncontrollable/controllable components
See original GitHub issueWhen rendering a custom component, the component gets rendered without a value. When you start typing, it gets a value, thus changing to a controllable input. I think the source of the problem is with the getValue() function. Which might need to be changed to:
getValue: function () { return this.state._value || ""; }
Not sure if this alone will fix it though. Haven’t had this issue in v0.17.
This is the error message I receive: _warning.js:44 Warning: TextField is changing a uncontrolled input of type email to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components_
Issue Analytics
- State:
- Created 7 years ago
- Reactions:13
- Comments:8 (2 by maintainers)
Same issue,
value={props.getValue() || ''}
fixes this for now.@uzarubin The HOC will attach the methods to
props
, the mixin tothis
.