const [uploadWindow, setUploadWindow] = useState(false); return ( <button onClick={() => setUploadWindow(!uploadWindow)}>Toggle it!</button> )
The default value for uploadWindow is false. On button click, it will change to be NOT false -> true. The next time the button is clicked, the value of uploadWindow will be true and it will be changed to be NOT true -> false.
There you go!