Created
November 16, 2021 09:32
-
-
Save Keraito/0ea72e68cb08e572ddc224bbe16136eb 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
const Component = () => { | |
const [showImage, setShowImage] = useState(true); | |
const hideImage = useCallback(() => { | |
if (showImage) { | |
setShowImage(false); | |
} | |
}, [showImage]); | |
return ( | |
<Card> | |
{showImage ? <CardImageCover /> : null} | |
<CardDescription /> | |
<CardButton onClick={hideImage} /> | |
</Card> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment