motiondivision / motion

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

Fix double `.update()` call on mount #2852

Closed mattgperry closed 3 weeks ago

mattgperry commented 3 weeks ago

This PR ensures that the insertion effect responsible for updating props from a motion commit to its VisualElement only runs when the VisualElement is hydrated with an element reference. This cuts an unnecessary .update() call on mount.