MemoryLeak MemoryLeak - 3 years ago 232
Javascript Question

how to set default value to numeric input field in reactjs?

I am working on a sample reactjs form, which has a input number field as shown below:

<input type="number" name="quantity"

How to set the default value to 5 for the numeric field?

Answer Source

You would need to set the initial state of userCount to 5 check the docs :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download