Skip to content

Commit cbeb449

Browse files
fix: ??
1 parent 78af7ce commit cbeb449

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/utils.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import { overlay, useTheme } from 'react-native-paper'
33
import Color from 'color'
44

55
export function useLatest<T>(value: T) {
6-
const valueRef = React.useRef<T>(value)
7-
React.useEffect(() => {
8-
valueRef.current = value
9-
}, [value])
10-
return valueRef
6+
const ref = React.useRef(value)
7+
ref.current = value
8+
return ref
119
}
1210

1311
export function useHeaderBackgroundColor() {

0 commit comments

Comments
 (0)