import React from 'react';
import './App.css';
import { Button } from 'react-bootstrap';
function App() {
return (
<div>
<input type="checkbox" id="checkboxForHamburger" />
<Button onClick={??????}> UNCHECK </Button>
</div>
);
}
export default App;
I have a Checkbox and a Button. I want the checkbox to be in "unchecked" state if the button is clicked.
What I tried-
<Button onClick={document.getElementById("checkboxForHamburger").checked = false}> UNCHECK </Button>
This is giving me an error - Cannot set property 'checked' of null