Skip to content

Commit 3eb80e4

Browse files
committed
fix: use React ref to create Animated.Value instead of useAnimatedValue to support react-native-web
1 parent c7eade7 commit 3eb80e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/caret.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { useEffect } from 'react';
2-
import { StyleSheet, Animated, useAnimatedValue } from 'react-native';
1+
import { useEffect, useRef } from 'react';
2+
import { StyleSheet, Animated } from 'react-native';
33
import { DEFAULT_DARK_COLOR } from '../constants';
44
import { useTextInputOTP } from '../hooks/use-text-input-otp';
55

66
export function Caret() {
7-
const opacity = useAnimatedValue(0);
7+
const opacity = useRef(new Animated.Value(0)).current;
88
const { caretColor } = useTextInputOTP();
99

1010
useEffect(() => {

0 commit comments

Comments
 (0)