Skip to content

Commit cf226be

Browse files
authored
fix(🐎): Fix regression with Reanimated (#2482)
1 parent 391fb9a commit cf226be

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

package/src/external/reanimated/useAnimatedImageValue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect } from "react";
2-
import { type FrameInfo, type SharedValue } from "react-native-reanimated";
2+
import type { FrameInfo, SharedValue } from "react-native-reanimated";
33

44
import { useAnimatedImage } from "../../skia/core/AnimatedImage";
55
import type { DataSourceParam, SkImage } from "../../skia/types";

package/src/external/reanimated/useVideoLoading.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { useEffect, useState } from "react";
2-
import {
3-
createWorkletRuntime,
4-
runOnJS,
5-
runOnRuntime,
6-
} from "react-native-reanimated";
72

83
import type { Video } from "../../skia/types";
94
import { Skia } from "../../skia";
105

11-
const runtime = createWorkletRuntime("video-metadata-runtime");
6+
import Rea from "./ReanimatedProxy";
7+
8+
const runtime = Rea.createWorkletRuntime("video-metadata-runtime");
129

1310
type VideoSource = string | null;
1411

@@ -17,11 +14,11 @@ export const useVideoLoading = (source: VideoSource) => {
1714
const cb = (src: string) => {
1815
"worklet";
1916
const vid = Skia.Video(src) as Video;
20-
runOnJS(setVideo)(vid);
17+
Rea.runOnJS(setVideo)(vid);
2118
};
2219
useEffect(() => {
2320
if (source) {
24-
runOnRuntime(runtime, cb)(source);
21+
Rea.runOnRuntime(runtime, cb)(source);
2522
}
2623
}, [source]);
2724
return video;

0 commit comments

Comments
 (0)