Skip to content

Commit 153385c

Browse files
committed
simplify logic props creation
1 parent f0ea23f commit 153385c

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

packages/react-native-gesture-handler/src/v3/LogicDetector.tsx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,16 @@ export function LogicDetector<THandlerData, TConfig>(
4949
return;
5050
}
5151

52-
const logicProps =
53-
Platform.OS === 'web'
54-
? {
55-
viewRef,
56-
viewTag,
57-
handlerTags: isComposedGesture(props.gesture)
58-
? props.gesture.tags
59-
: [props.gesture.tag],
60-
}
61-
: {
62-
viewTag,
63-
handlerTags: isComposedGesture(props.gesture)
64-
? props.gesture.tags
65-
: [props.gesture.tag],
66-
};
52+
const logicProps = {
53+
viewTag,
54+
handlerTags: isComposedGesture(props.gesture)
55+
? props.gesture.tags
56+
: [props.gesture.tag],
57+
};
58+
59+
if (Platform.OS === 'web') {
60+
Object.assign(logicProps, { viewRef });
61+
}
6762

6863
register(logicProps, logicMethods as RefObject<GestureEvents<unknown>>);
6964

0 commit comments

Comments
 (0)