开发者

how to create form using react js?

开发者 https://www.devze.com 2022-12-07 17:50 出处:网络
<form> <label> Name: <input type="text" name="name"开发者_如何学JAVA />
<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

0

精彩评论

暂无评论...
验证码 换一张
取 消