Introduction to Controlled Inputs
Learn what controlled inputs are and how to use them.
We'll cover the following...
Two different concepts are important to making controlled inputs work: the component state and onChange
methods. To change the properties of React components, the creation of a new component object to replace the original is necessary. It minimizes the places where the application state may reside. Of course, it has its limits. If every component is unchangeable, we have a static page rather than a dynamic web application. Therefore, the state must change somewhere.
Methods of rendering the change
Controlled inputs handle the common case of user inputs by having the component manage the input’s state. This keeps the state self-contained. The information ...