You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Trying to get the value returned from useTransorm but the current value that is returned stays the same.
But the div that is reading the color value is however updating.. Am I doing anything wrong here?
const y = useMotionValue(0);
const yInput = [-20, -0.1, 0, 0.1, 20];
let background = useTransform(y, yInput, [
"#FF0000",
"#00FF00",
"#202224",
"#00FF00",
"#0000FF",
]);
$: console.log("Background:", background) //this line outputs each change but not the change in the value.
**** unimportant lines ****
<Motion
drag={dragEnabled}
dragConstraints={{ top: 0, left: 0, right: 0, bottom: 0 }}
dragElastic={{ top: 0.1, left: 0.1, right: 0.1, bottom: 0.1 }}
onDragEnd={dragEnd}
onPanEnd={panEnd}
onDrag={onDrag}
dragDirectionLock={true}
style={{ y, background }}
let:motion
>
*div*
</Motion>
The text was updated successfully, but these errors were encountered:
Hi. Trying to get the value returned from useTransorm but the current value that is returned stays the same.
But the div that is reading the color value is however updating.. Am I doing anything wrong here?
The text was updated successfully, but these errors were encountered: