Created
August 15, 2019 05:47
-
-
Save timneutkens/3fd5946b2e52bd1cdd42467c4ba2959e 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 {useState, useEffect} from 'react' | |
function useMounted() { | |
const [isMounted, setMounted] = useState(false) | |
useEffect(() => setMounted(true), []) | |
return isMounted | |
} | |
// const isMounted = useMounted() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment