How to make default checked for radio buttons in react?

Using the defaultChecked property, available for <input type="checkbox"> and <input type="radio"> – https://reactjs.org/docs/uncontrolled-components.html#default-values

<input type="radio" name="radio-group" value="1" defaultChecked />
<input type="radio" name="radio-group" value="2" />
<input type="radio" name="radio-group" value="3" />

Leave a Comment