InterviewSolution
| 1. |
How To Use Forms In Reactjs? |
|
Answer» In React’s virtual DOM, HTML Input ELEMENT presents an interesting PROBLEM. With the others DOM environment, we can render the input or textarea and thus allows the browser MAINTAIN its state that is (its value). we can then get and set the value implicitly with the DOM API. In HTML, form elements such as <input>, <textarea>, and <select> itself maintain their own state and update its state based on the input provided by user .In React, components’ mutable state is handled by the state property and is only updated by setState().
In React’s virtual DOM, HTML Input element presents an interesting problem. With the others DOM environment, we can render the input or textarea and thus allows the browser maintain its state that is (its value). we can then get and set the value implicitly with the DOM API. In HTML, form elements such as <input>, <textarea>, and <select> itself maintain their own state and update its state based on the input provided by user .In React, components’ mutable state is handled by the state property and is only updated by setState(). |
|