Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

framer motion reactjs

import { motion } from 'framer-motion';

//use key with router if you are trying to do page transitions
function App ({ Component, pageProps, router}) {
	return (
   		<motion.div key={router.router} initial="pageInitial" animate="pageAnimate" variants={{
       		pageInitial: {
				opacity:0
			},
      		pageAnimate: {
           		opacity:1 
            },
		}}>
        	<Component {...pageProps} />
		</motion.div>
    )	
}

export default App;
 
PREVIOUS NEXT
Tagged: #framer #motion #reactjs
ADD COMMENT
Topic
Name
8+3 =