mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-31 17:53:50 +00:00
@@ -81,12 +81,6 @@ function TouchableWithoutFeedback(props: Props, forwardedRef): React.Node {
|
|||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const hostRef = useRef(null);
|
const hostRef = useRef(null);
|
||||||
const setRef = setAndForwardRef({
|
|
||||||
getForwardedRef: () => forwardedRef,
|
|
||||||
setLocalRef: hostNode => {
|
|
||||||
hostRef.current = hostNode;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const pressConfig = useMemo(
|
const pressConfig = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
@@ -121,7 +115,20 @@ function TouchableWithoutFeedback(props: Props, forwardedRef): React.Node {
|
|||||||
supportedProps.accessible = accessible !== false;
|
supportedProps.accessible = accessible !== false;
|
||||||
supportedProps.accessibilityState = { disabled, ...props.accessibilityState };
|
supportedProps.accessibilityState = { disabled, ...props.accessibilityState };
|
||||||
supportedProps.focusable = focusable !== false && onPress !== undefined;
|
supportedProps.focusable = focusable !== false && onPress !== undefined;
|
||||||
supportedProps.ref = setRef;
|
supportedProps.ref = setAndForwardRef({
|
||||||
|
getForwardedRef: () => forwardedRef,
|
||||||
|
setLocalRef: hostNode => {
|
||||||
|
const { ref } = element;
|
||||||
|
if (ref != null) {
|
||||||
|
if (typeof ref === 'function') {
|
||||||
|
ref(hostNode);
|
||||||
|
} else {
|
||||||
|
ref.current = hostNode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hostRef.current = hostNode;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const elementProps = Object.assign(supportedProps, pressEventHandlers);
|
const elementProps = Object.assign(supportedProps, pressEventHandlers);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user