File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
package/src/external/reanimated Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type {
3
3
FrameInfo ,
4
4
SharedValue ,
5
5
} from "react-native-reanimated" ;
6
- import { useCallback , useMemo , useRef } from "react" ;
6
+ import { useCallback , useMemo } from "react" ;
7
7
8
8
import type { SkPath , SkPoint } from "../../skia/types" ;
9
9
import { interpolatePaths , interpolateVector } from "../../animation" ;
@@ -13,7 +13,7 @@ import {
13
13
useAnimatedReaction ,
14
14
useFrameCallback ,
15
15
useSharedValue ,
16
- useDerivedValue
16
+ useDerivedValue ,
17
17
} from "./moduleWrapper" ;
18
18
19
19
export const notifyChange = ( value : SharedValue < unknown > ) => {
@@ -37,10 +37,13 @@ export const usePathValue = (cb: (path: SkPath) => void) => {
37
37
38
38
export const useClock = ( ) => {
39
39
const clock = useSharedValue ( 0 ) ;
40
- const callback = useCallback ( ( info : FrameInfo ) => {
41
- "worklet" ;
42
- clock . value = info . timeSinceFirstFrame ;
43
- } , [ ] ) ;
40
+ const callback = useCallback (
41
+ ( info : FrameInfo ) => {
42
+ "worklet" ;
43
+ clock . value = info . timeSinceFirstFrame ;
44
+ } ,
45
+ [ clock ]
46
+ ) ;
44
47
useFrameCallback ( callback ) ;
45
48
return clock ;
46
49
} ;
Original file line number Diff line number Diff line change @@ -43,8 +43,10 @@ export const useSharedValue: <T>(
43
43
oneWayReadsOnly ?: boolean
44
44
) => SharedValue < T > = Reanimated2 ?. useSharedValue || throwOnMissingReanimated ;
45
45
46
-
47
- export const useDerivedValue : < T > ( processor : ( ) => T , dependencies ?: DependencyList ) => DerivedValue < T > = Reanimated2 ?. useDerivedValue || throwOnMissingReanimated ;
46
+ export const useDerivedValue : < T > (
47
+ processor : ( ) => T ,
48
+ dependencies ?: DependencyList
49
+ ) => DerivedValue < T > = Reanimated2 ?. useDerivedValue || throwOnMissingReanimated ;
48
50
49
51
export const useFrameCallback : (
50
52
callback : ( frameInfo : FrameInfo ) => void ,
You can’t perform that action at this time.
0 commit comments