Skip to content

Commit ab3fbf0

Browse files
committed
Update docs
1 parent aa88821 commit ab3fbf0

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

package/src/external/reanimated/interpolators.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
FrameInfo,
44
SharedValue,
55
} from "react-native-reanimated";
6-
import { useCallback, useMemo, useRef } from "react";
6+
import { useCallback, useMemo } from "react";
77

88
import type { SkPath, SkPoint } from "../../skia/types";
99
import { interpolatePaths, interpolateVector } from "../../animation";
@@ -13,7 +13,7 @@ import {
1313
useAnimatedReaction,
1414
useFrameCallback,
1515
useSharedValue,
16-
useDerivedValue
16+
useDerivedValue,
1717
} from "./moduleWrapper";
1818

1919
export const notifyChange = (value: SharedValue<unknown>) => {
@@ -37,10 +37,13 @@ export const usePathValue = (cb: (path: SkPath) => void) => {
3737

3838
export const useClock = () => {
3939
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+
);
4447
useFrameCallback(callback);
4548
return clock;
4649
};

package/src/external/reanimated/moduleWrapper.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ export const useSharedValue: <T>(
4343
oneWayReadsOnly?: boolean
4444
) => SharedValue<T> = Reanimated2?.useSharedValue || throwOnMissingReanimated;
4545

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;
4850

4951
export const useFrameCallback: (
5052
callback: (frameInfo: FrameInfo) => void,

0 commit comments

Comments
 (0)