Investigate removal of framer-motion
#6678
Labels
Debt
Experience dropped or altered for implementation release and deferred until later
dependencies
Pull requests that update a dependency file
role: dev
Milestone
While
framer-motion
has been a very convenient tool in orchestrating animations and transitions, we've faced issues in managing it as a dependency given our requirement for continued support of React 16 and up.After doing a quick review of where and how we're using it, I think we should be able to do everything we're currently doing with
framer-motion
now with native css. For example, creating an animation on render (which we've commonly relied onAnimatePresence
for), can be done all in css now, here is an quick example:See codepen example here.
With
transition-behavior: allow-discrete;
, properties likedisplay
can also be used in transitions.AnimatePresence
, add fallback solution of css animation for older browsers (found that my current version of Safari doesn't support thetransition-behavior
property), created a prototype showing how we could do this hereusePresence
hook from prototype toibm-products
and replaceAnimatePresence
framer-motion componentuseReducedMotion
fromframer-motion
, we have a custom hook for this already but have also imported the reduced motion hook fromframer-motion
in some placesmotion.div
(FilterPanel, FilterSummary, OptionsTile, SidePanel)I think it will be easiest to go through this list above for each component individually rather than jumping across multiple components to remove singular pieces of
framer-motion
. I'll create sub-issues for each component that is remaining.Example usage of
usePresence
custom hook for mount/unmount transitionsThe text was updated successfully, but these errors were encountered: