Animate React Components (not just native DOM elements)
See original GitHub issueI quite often use the @reach/dialog
package for creating modals or other things things like off-screen mobile menus.
I’d like to animate the <DialogOverlay>
and <DialogContent>
components using Framer Motion.
In react-spring
, I could do something like this:
const AnimatedDialogOverlay = animated(DialogOverlay);
const AnimatedDialogContent = animated(DialogContent);
Is there a way to do something similar in Framer Motion or can you only animate native DOM elements?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Animation Add-Ons - React
Every DOM component that React can render is available for use. However, component does not need to be a DOM component. It can...
Read more >Animate React components with a single line using AutoAnimate
AutoAnimate makes for a smooth experience when an element changes in the DOM. I would like to compare AutoAnimate with React Transition ...
Read more >How to Animate Components' Entrance and Exit in React
React Transition Group does NOT do the animation for you, that is it does not provide the animation. It facilitates adding the animation...
Read more >Animations with React: How a simple component can affect ...
Next, we will use the useEffect hook to synchronize our component with the DOM state. When the element is mounted, and after we...
Read more >5 Ways to animate a React app. - Medium
React Transition Group changes the classes when component lifecycle changes. In turn, animated style should be described in CSS classes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure thing @lednhatkhanh, here is an example:
@lukebennett88 Thank you so much!