Last active
March 19, 2022 12:11
-
-
Save Ladvace/fb5950d41c5879d554251b6d54b0ae8d to your computer and use it in GitHub Desktop.
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' | |
export const Component = () => { | |
const [show, setShow] = useState(false) | |
const handleClick = () => { | |
setShow(prev => !prev) | |
} | |
return ( | |
<div> | |
{show ? <p>You can see this string</p> : null} | |
<button onClick={handleClick}>Click Here to toggle</button> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment