Created
May 22, 2021 15:50
-
-
Save Sergioamjr/2d6007cd2c2ddb66c2620f6f9c2ba1e3 to your computer and use it in GitHub Desktop.
Revisions
-
Sergioamjr created this gist
May 22, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ import { useState, useLayoutEffect } from "react"; function Component() { const [isDOMLoaded, setIsDOMLoaded] = useState(false); useLayoutEffect(() => { setIsDOMLoaded(true); window.localstorage.getItem("..."); }, []); return( //... ) }