How do you set a default value for an uncontrolled component?

  • Use the value attribute
  • Use the defaultValue attribute
  • Use the setState() method
  • Use the props attribute
In React, uncontrolled components are form components that store their own state internally. To set a default value for an uncontrolled component, you can use the defaultValue attribute. This will set the initial value of the component when it first renders.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *