framer / motion

Open source, production-ready animation and gesture library for React
https://framer.com/motion
MIT License
22.27k stars 733 forks source link

Fixing layout projection with `motion(Fragment)` nodes #2605

Closed mattgperry closed 1 month ago

mattgperry commented 1 month ago

This PR skips adding motion(Fragment) nodes to the layout projection tree.

We added these nodes to allow animating variants via a renderless component rather than being bound to a div etc (@adamseckel has more context)

The problem with these nodes is layout animation scale correction is presumed to be performed by a child node, thus these nodes were swallowing the scale corrective calculations.