Relative Content

Tag Archive for next.jsframer-motionstoryblokframer-animatepresence

AnimatePresence Framer Motion with NextJS and Storyblok

export default function MyApp({ Component, pageProps, router }){ const [ isLoading, setIsLoading ] = useState(true) useEffect(() => { if(isLoading === true) { document.querySelector(“body”).classList.add(“no-scroll”) } else { document.querySelector(“body”).classList.remove(“no-scroll”) } }, [isLoading]) return ( <main className={`${new_york.variable} ${montserrat.variable} ${aldo_apache.variable}`}> <Layout story={pageProps.config}> <AnimatePresence mode=”wait” initial={false} onExitComplete={() => window.scrollTo(0, 0)}> {isLoading ? ( <Loader setIsLoading={setIsLoading} /> ) : ( <Component […]