Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function App() {
const [initialized, setInitialized] = useState(false);
const [clicked, setClicked] = useState(false);
useEffect(() => {
return (
<div className="App">
{initialized && <h1>Initialized</h1>}
<h1 onClick={() => setClicked(true)}>Please click me!</h1>
{clicked && <h2>You clicked an object!</h2>}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.