I want to add a preloader in my nextjs app.
my _app.js file
// a loading file inside components folder
import Loader from '../components/loader'
    function MyApp({ Component, pageProps }) {
    return <>
        <Component {...pageProps} />
           </>
    }
export default MyApp
how can I add a loader when the page load at the first time in next js because there is no window property so i can't use window.onload
please tell me if any solution is there
