Skip to content

Commit 4cd041b

Browse files
committed
add back animations
1 parent 449936a commit 4cd041b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/core/native/index.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ import {
2121
Text,
2222
matchFont,
2323
} from '@shopify/react-native-skia';
24-
import { useSharedValue, useDerivedValue } from 'react-native-reanimated';
24+
import {
25+
useSharedValue,
26+
useDerivedValue,
27+
withTiming,
28+
} from 'react-native-reanimated';
2529
import { PendingOutline } from '../web/outline';
2630

2731
export const genId = (): string => {
@@ -299,7 +303,14 @@ export const ReactNativeScanEntryPoint = () => {
299303
const ReactNativeScan = ({ id: _ }: { id: string }) => {
300304
const { width, height } = Dimensions.get('window');
301305
const outlines = useSyncExternalStore(
302-
(listener) => ReactScanInternals.subscribe('activeOutlines', listener),
306+
(listener) =>
307+
ReactScanInternals.subscribe('activeOutlines', (value) => {
308+
opacity.value = 1;
309+
opacity.value = withTiming(0, {
310+
duration: 300,
311+
});
312+
listener();
313+
}),
303314
() => ReactScanInternals.activeOutlines,
304315
);
305316
const opacity = useSharedValue(1);

0 commit comments

Comments
 (0)