framer/motion v2.0.0 Release Notes

Release Date: 2020-07-15 // almost 4 years ago
  • โž• Added

    • layout prop for automatic layout animations.
    • AnimateSharedLayout and layoutId for shared layout animations.
    • onMeasureDragConstraints prop that fires when dragConstraints are measured.
    • useIsPresent, a read-only version of usePresence.
    • Allow dragConstraints to be a ref that is smaller than the draggable element.

    โœ‚ Removed

    • positionTransition and layoutTransition props (use layout={true} instead).
    • Point type in favour of Point2D.
    • ๐Ÿšš useAnimatedState: Moved to Framer library.
    • dragOriginX, dragOriginY props.
    • ๐Ÿ’… stylefire as a dependency.

    ๐Ÿ›  Fixed

    • ๐Ÿ’… Removing a MotionValue from style now correctly unsets it from the element.

    ๐Ÿ”„ Changed

    • ๐ŸŒ Using Proxy to generate motion components. This saves ~0.5kb from the bundle size and ensures compatibility with all DOM elements and Web Components.
    • x and y transform values won't change as a result of a drag gesture as this now works via layout projection.
    • Drag events now report point as the pointer relative to the viewport, in line with other pointer events.
    • ๐Ÿ— Changed build process and using Terser for uglification. Reduces bundle size by ~1.2kb. (@stokesman in #596)