motiondivision / motion

A modern animation library for React and JavaScript
https://motion.dev
MIT License
25.67k stars 843 forks source link

Adding `motion.create()` #2787

Closed mattgperry closed 2 months ago

mattgperry commented 2 months ago

In this PR we added a new entrypoint for motion components that's compatible with React Server Components.

The issue with import * as x is you remove the ability to support Proxy or other dynamically-assigned objects so the pattern of supporting motion(Component) and motion.div breaks.

This PR deprecates motion(Component) in favour of motion.create(Component)