Skip to content

Commit 25305e4

Browse files
committed
Update TouchableWithoutFeedback.windows.js
1 parent f18432b commit 25305e4

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

vnext/src-win/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,15 @@ const PASSTHROUGH_PROPS = [
130130
'tooltip', // [Windows]
131131
];
132132

133-
export default function TouchableWithoutFeedback(props: Props): React.Node {
133+
// Modify the function to accept the ref prop and forward it
134+
// $FlowFixMe[prop-missing]
135+
const TouchableWithoutFeedback: React.AbstractComponent<
136+
Props,
137+
React.ElementRef<typeof Animated.View>,
138+
> = React.forwardRef(function TouchableWithoutFeedback(
139+
props: Props,
140+
ref,
141+
): React.Node {
134142
const {
135143
disabled,
136144
rejectResponderTermination,
@@ -261,5 +269,7 @@ export default function TouchableWithoutFeedback(props: Props): React.Node {
261269
}
262270

263271
// $FlowFixMe[incompatible-call]
264-
return React.cloneElement(element, elementProps, ...children);
265-
}
272+
return React.cloneElement(element, {...elementProps, ref}, ...children);
273+
});
274+
275+
export default TouchableWithoutFeedback;

0 commit comments

Comments
 (0)