I'm confused as to why React insists that I give my controlled text input components their own internal state. I followed the official documentation for creating a controlled input, and React is squawking at me via the console:
*warning.js:36 Warning: ClientInfoTextInput is changing an uncontrolled input of type text 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.
render() {
return (
<input type="text"
className={styles.ClientInfoTextInput}
value={this.props.propToPass}
onChange={this.props.propMethodToPass}
/>
)
So why can't I pass down state via props to a controlled input component without React getting upset?