Created
May 11, 2021 12:19
-
-
Save bengrunfeld/b5dd1dd9084ce965601fdb365fbd45d2 to your computer and use it in GitHub Desktop.
React Testing Library - Async Component
This file contains hidden or 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 App = () => { | |
const [loggedIn, setLoggedIn] = useState(false) | |
useEffect(() => { | |
setTimeout(() => setLoggedIn(true), 1000) | |
}, []) | |
return ( | |
<button>{loggedIn ? "Log Out" : "Log In"}</button> | |
) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment