Using framer-motion, I have an issue where updating the object I pass on the custom
prop to the motion.div
variants doesn't trigger the expected style change.
I created the following sandbox in order to demonstrate the issue:
https://codesandbox.io/s/framer-motion-stale-custom-fibp5?file=/src/App.js
My expectation is that when I toggle the theme - the circle's on/off colors will immediately change based on the new theme. (from black/white to darkblue/yellow and vice versa).
However, the theme changes are applied only once the animation value is changed (status changes from "on" to "off" etc.) So when I toggle the theme, I'm showing a "stale" theme value until I also toggle the status (on/off).
Any help would be greatly appreciated.