how to create form using react js?
<form>
<label>
Name:
<input type="text" name="name"开发者_如何学JAVA />
</label>
<input type="submit" value="Submit" />
</form>
such as <input>
, <textarea>
, and <select>
typically maintain their own state and update it based on user input. In React, mutable state is typically kept in the state property of components, and only updated with setState()
.
If I got your point.
The thing you need is Uncontrolled Components
.
Take a look at this document: Uncontrolled Components
It might help you
you can still use document.getElementById
if it helps in your case
精彩评论