Every time I click on the radio buttons, they don't get selected with the blue mark. I would like to know what I'm doing wrong here. This is the code:
import { useState } from "react";
const Form = () => {
const [clicked, setClick] = useState("v_likely");
const clickedRadio = () => {
setClick(clicked);
}
return (
<div className="form">
<div className="radio_button" style={{ fontSize: "12px" }}>
<label>Would you recommend to a friend?</label>
<div className="radio">
<div>
<input type="radio" name="v_likely" value={clicked} checked={clicked === "v_likely"} onClick={clickedRadio}></input>
<label>Very Likely</label>
</div>
<div>
<input type="radio" name="likely" value={clicked} checked={clicked === "likely"} onClick={clickedRadio}></input>
<label>Likely</label>
</div>
<div>
<input type="radio" name="think" value={clicked} checked={clicked === "think"} onClick={clickedRadio}></input>
<label>Will Think</label>
</div>
<div>
<input type="radio" name="no" value={clicked} checked={clicked === "no"} onClick={clickedRadio}></input>
<label>Not At All</label>
</div>
</div>
</div>
</div>
);
}
export default Form;