-
-
Save silkstudio/e351858075eb95176e1f0d7761c0bca3 to your computer and use it in GitHub Desktop.
How to use Styled Components in conjunction with Framer Motion
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
| import styled from "styled-components" | |
| import { motion } from "framer-motion" | |
| const StyledMotionComponent = styled(motion.div)` | |
| /* ----- your styles go here ---- */ | |
| ` | |
| /** | |
| * initial, animate and exit props can now be passed | |
| * to this component just like a normal motion.div | |
| * | |
| */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment