<br />
<input type='radio' name='delivery_stat' id='delivery' ></input>
<label htmlFor="pending" >Pending delivery</label>
<br />
<input type='radio' name='delivery_stat' id='delivery' ></input>
<label htmlFor="done" >Complete delivery</label>
There are two options. Either pending delivery or complete delivery. If user select pending delivery then how do I get that value in my code in react.
Firstly, you need to define
useState
for the selected value from the radio buttonsAnd then, you should have a click event to handle radio selection
Lastly, you should add
value='Pending delivery'
andonChange={handleChange}
to radio elementsFull possible change