(props)
| 2 | import { Button, ButtonGroup } from 'reactstrap'; |
| 3 | |
| 4 | function Example(props) { |
| 5 | const [cSelected, setCSelected] = useState([]); |
| 6 | const [rSelected, setRSelected] = useState(null); |
| 7 | |
| 8 | const onCheckboxBtnClick = (selected) => { |
| 9 | const index = cSelected.indexOf(selected); |
| 10 | if (index < 0) { |
| 11 | cSelected.push(selected); |
| 12 | } else { |
| 13 | cSelected.splice(index, 1); |
| 14 | } |
| 15 | setCSelected([...cSelected]); |
| 16 | }; |
| 17 | return ( |
| 18 | <div> |
| 19 | <h5>Radio Buttons</h5> |
| 20 | <ButtonGroup> |
| 21 | <Button |
| 22 | color="primary" |
| 23 | outline |
| 24 | onClick={() => setRSelected(1)} |
| 25 | active={rSelected === 1} |
| 26 | > |
| 27 | Radio 1 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…