Skip to content

Commit 54abf0c

Browse files
authored
fix: correctly check for non-null object (gorhom#1122)(by @stropho)
1 parent f3f9ef4 commit 54abf0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/useReactiveSharedValue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const useReactiveSharedValue = <T>(
1111
const initialValueRef = useRef<T>(null);
1212
const valueRef = useRef<Animated.SharedValue<T>>(null);
1313

14-
if (typeof value === 'object' && 'value' in value) {
14+
if (value && typeof value === 'object' && 'value' in value) {
1515
/**
1616
* if provided value is a shared value,
1717
* then we do not initialize another one.

0 commit comments

Comments
 (0)