We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78af7ce commit cbeb449Copy full SHA for cbeb449
src/utils.ts
@@ -3,11 +3,9 @@ import { overlay, useTheme } from 'react-native-paper'
3
import Color from 'color'
4
5
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
+ const ref = React.useRef(value)
+ ref.current = value
+ return ref
11
}
12
13
export function useHeaderBackgroundColor() {
0 commit comments