Created
May 22, 2021 15:50
-
-
Save Sergioamjr/2d6007cd2c2ddb66c2620f6f9c2ba1e3 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, useLayoutEffect } from "react"; | |
function Component() { | |
const [isDOMLoaded, setIsDOMLoaded] = useState(false); | |
useLayoutEffect(() => { | |
setIsDOMLoaded(true); | |
window.localstorage.getItem("..."); | |
}, []); | |
return( | |
//... | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment