1import React from "react";
2
3function Radio () {
4 const [status, setStatus] = React.useState(0) // 0: no show, 1: show yes, 2: show no.
5
6 const radioHandler = (status) => {
7 setStatus(status);
8 };
9
10 return (
11 <>
12 <input type="radio" name="release" checked={status === 1} onClick={(e) => radioHandler(1)} />
13 <input type="radio" name="release" checked={status === 2} onClick={(e) => radioHandler(2)} />
14 {status === 1 && drawYesContent()}
15 {status === 2 && drawNoContent()}
16 </>
17 );
18}
19
20export default Radio;
21