Last active
September 27, 2022 10:12
-
-
Save sand97/35680c38f89aa2a7d8c611b7b7856dc8 to your computer and use it in GitHub Desktop.
Example of Nextjs Splash screen _app.js
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
function MyApp({ Component, pageProps }) { | |
// Hide splash screen shen we are server side | |
useEffect(() => { | |
if (typeof window !== 'undefined') { | |
const loader = document.getElementById('globalLoader'); | |
if (loader) | |
loader.style.display = 'none'; | |
} | |
}, []); | |
return <Component {...pageProps} /> | |
} | |
export default MyApp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment