Created
July 29, 2021 02:02
-
-
Save Brlaney/bc01f90b493485a19d125f9087d2d930 to your computer and use it in GitHub Desktop.
Using framer motion with next.js
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 * as React from 'react' | |
import type { AppProps /*, AppContext */ } from 'next/app' | |
import Head from 'next/head' | |
import { useRouter } from 'next/router' | |
import { AnimatePresence } from 'framer-motion' | |
import theme from '@/lib/theme/theme' | |
import '@/styles/globals.scss' | |
export default function MyApp (props: AppProps) { | |
const { Component, pageProps } = props | |
const router = useRouter() | |
return ( | |
<Head> | |
<meta charSet='utf-8' /> | |
<meta name='viewport' content='width=device-width, initial-scale=1' /> | |
<meta name='keywords' content='keywords' /> | |
<meta name='description' content='description' /> | |
<title>title</title> | |
</Head> | |
<AnimatePresence> | |
<Component {...pageProps} key={router.route} /> | |
</AnimatePresence> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment