Created
July 28, 2020 13:08
-
-
Save ikr4-m/203132682f20f2e0765c9d4906cbb9c8 to your computer and use it in GitHub Desktop.
Seperti judul filenya
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react' | |
import Overlay from './Overlay' | |
function App () { | |
const [showOverlay, setOverlay] = useState(false) | |
function triggerOverlay (event) { | |
event.preventDefault() | |
showOverlay ? setOverlay(false) : setOverlay(true) | |
} | |
return ( | |
<div className="App"> | |
<button onClick={triggerOverlay.bind(this)}>Munculkan overlay!</button> | |
{showOverlay ? <Overlay /> : null} | |
</div> | |
) | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment