Skip to content

Commit 1c917ef

Browse files
committed
fix: useTransform not updating when reactive value changes
1 parent 794f856 commit 1c917ef

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/motion/src/value/use-combine-values.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ export function useCombineMotionValues<T>(
3939
subscribe,
4040
unsubscribe,
4141
value,
42+
updateValue,
4243
}
4344
}

packages/motion/src/value/use-computed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function useComputed<T>(computed: () => T): MotionValue<T> {
99
*/
1010
collectMotionValues.current = []
1111

12-
const { value, subscribe, unsubscribe } = useCombineMotionValues<T>(computed)
12+
const { value, subscribe, unsubscribe, updateValue } = useCombineMotionValues<T>(computed)
1313

1414
subscribe(collectMotionValues.current)
1515

@@ -18,7 +18,7 @@ export function useComputed<T>(computed: () => T): MotionValue<T> {
1818
onBeforeUpdate(() => {
1919
unsubscribe()
2020
collectMotionValues.current = []
21-
computed()
21+
updateValue()
2222
subscribe(collectMotionValues.current)
2323
collectMotionValues.current = undefined
2424
})

0 commit comments

Comments
 (0)