Afficher et masquer DIV en fonction du bouton radio cliquez sur réagir
import React from "react";
function Radio () {
const [status, setStatus] = React.useState(0) // 0: no show, 1: show yes, 2: show no.
const radioHandler = (status) => {
setStatus(status);
};
return (
<>
<input type="radio" name="release" checked={status === 1} onClick={(e) => radioHandler(1)} />
<input type="radio" name="release" checked={status === 2} onClick={(e) => radioHandler(2)} />
{status === 1 && drawYesContent()}
{status === 2 && drawNoContent()}
</>
);
}
export default Radio;
Clumsy Capuchin