We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(): PressRetentionOffset => this.props.pressRetentionOffset == null ? PRESS_RECT_OFFSET : this.props.pressRetentionOffset
Fulll context
class Text extends ReactNative.NativeComponent<Props, State> { static propTypes = TextPropTypes; static defaultProps = { accessible: true, allowFontScaling: true, ellipsizeMode: 'tail', }; touchableGetPressRectOffset: ?() => PressRetentionOffset; touchableHandleActivePressIn: ?() => void; touchableHandleActivePressOut: ?() => void; touchableHandleLongPress: ?(event: PressEvent) => void; touchableHandlePress: ?(event: PressEvent) => void; touchableHandleResponderGrant: ?( event: SyntheticEvent<>, dispatchID: string, ) => void; touchableHandleResponderMove: ?(event: SyntheticEvent<>) => void; touchableHandleResponderRelease: ?(event: SyntheticEvent<>) => void; touchableHandleResponderTerminate: ?(event: SyntheticEvent<>) => void; touchableHandleResponderTerminationRequest: ?() => boolean; state = { ...Touchable.Mixin.touchableGetInitialState(), isHighlighted: false, createResponderHandlers: this._createResponseHandlers.bind(this), responseHandlers: null, }; static getDerivedStateFromProps(nextProps: Props, prevState: State): ?State { return prevState.responseHandlers == null && isTouchable(nextProps) ? { ...prevState, responseHandlers: prevState.createResponderHandlers(), } : null; } static viewConfig = viewConfig; render(): React.Node { let props = this.props; if (isTouchable(props)) { props = { ...props, ...this.state.responseHandlers, isHighlighted: this.state.isHighlighted, }; } if (props.selectionColor != null) { props = { ...props, selectionColor: processColor(props.selectionColor), }; } if (__DEV__) { if (Touchable.TOUCH_TARGET_DEBUG && props.onPress != null) { props = { ...props, style: [props.style, {color: 'magenta'}], }; } } return ( <TextAncestor.Consumer> {hasTextAncestor => hasTextAncestor ? ( <RCTVirtualText {...props} /> ) : ( <TextAncestor.Provider value={true}> <RCTText {...props} /> </TextAncestor.Provider> ) } </TextAncestor.Consumer> ); } _createResponseHandlers(): ResponseHandlers { return { onStartShouldSetResponder: (): boolean => { const {onStartShouldSetResponder} = this.props; const shouldSetResponder = (onStartShouldSetResponder == null ? false : onStartShouldSetResponder()) || isTouchable(this.props); if (shouldSetResponder) { this._attachTouchHandlers(); } return shouldSetResponder; }, onResponderGrant: (event: SyntheticEvent<>, dispatchID: string): void => { nullthrows(this.touchableHandleResponderGrant)(event, dispatchID); if (this.props.onResponderGrant != null) { this.props.onResponderGrant.apply(this, arguments); } }, onResponderMove: (event: SyntheticEvent<>): void => { nullthrows(this.touchableHandleResponderMove)(event); if (this.props.onResponderMove != null) { this.props.onResponderMove.apply(this, arguments); } }, onResponderRelease: (event: SyntheticEvent<>): void => { nullthrows(this.touchableHandleResponderRelease)(event); if (this.props.onResponderRelease != null) { this.props.onResponderRelease.apply(this, arguments); } }, onResponderTerminate: (event: SyntheticEvent<>): void => { nullthrows(this.touchableHandleResponderTerminate)(event); if (this.props.onResponderTerminate != null) { this.props.onResponderTerminate.apply(this, arguments); } }, onResponderTerminationRequest: (): boolean => { const {onResponderTerminationRequest} = this.props; if (!nullthrows(this.touchableHandleResponderTerminationRequest)()) { return false; } if (onResponderTerminationRequest == null) { return true; } return onResponderTerminationRequest(); }, }; }class Text extends ReactNative.NativeComponent<Props, State> { static propTypes = TextPropTypes; static defaultProps = { accessible: true, allowFontScaling: true, ellipsizeMode: 'tail', }; touchableGetPressRectOffset: ?() => PressRetentionOffset; touchableHandleActivePressIn: ?() => void; touchableHandleActivePressOut: ?() => void; touchableHandleLongPress: ?(event: PressEvent) => void; touchableHandlePress: ?(event: PressEvent) => void; touchableHandleResponderGrant: ?( event: SyntheticEvent<>, dispatchID: string, ) => void; touchableHandleResponderMove: ?(event: SyntheticEvent<>) => void; touchableHandleResponderRelease: ?(event: SyntheticEvent<>) => void; touchableHandleResponderTerminate: ?(event: SyntheticEvent<>) => void; touchableHandleResponderTerminationRequest: ?() => boolean; state = { ...Touchable.Mixin.touchableGetInitialState(), isHighlighted: false, createResponderHandlers: this._createResponseHandlers.bind(this), responseHandlers: null, }; static getDerivedStateFromProps(nextProps: Props, prevState: State): ?State { return prevState.responseHandlers == null && isTouchable(nextProps) ? { ...prevState, responseHandlers: prevState.createResponderHandlers(), } : null; } static viewConfig = viewConfig; render(): React.Node { let props = this.props; if (isTouchable(props)) { props = { ...props, ...this.state.responseHandlers, isHighlighted: this.state.isHighlighted, }; } if (props.selectionColor != null) { props = { ...props, selectionColor: processColor(props.selectionColor), }; } if (__DEV__) { if (Touchable.TOUCH_TARGET_DEBUG && props.onPress != null) { props = { ...props, style: [props.style, {color: 'magenta'}], }; } } return ( <TextAncestor.Consumer> {hasTextAncestor => hasTextAncestor ? ( <RCTVirtualText {...props} /> ) : ( <TextAncestor.Provider value={true}> <RCTText {...props} /> </TextAncestor.Provider> ) } </TextAncestor.Consumer> ); } _createResponseHandlers(): ResponseHandlers { return { onStartShouldSetResponder: (): boolean => { const {onStartShouldSetResponder} = this.props; const shouldSetResponder = (onStartShouldSetResponder == null ? false : onStartShouldSetResponder()) || isTouchable(this.props); if (shouldSetResponder) { this._attachTouchHandlers(); } return shouldSetResponder; }, onResponderGrant: (event: SyntheticEvent<>, dispatchID: string): void => { nullthrows(this.touchableHandleResponderGrant)(event, dispatchID); if (this.props.onResponderGrant != null) { this.props.onResponderGrant.apply(this, arguments); } }, onResponderMove: (event: SyntheticEvent<>): void => { nullthrows(this.touchableHandleResponderMove)(event); if (this.props.onResponderMove != null) { this.props.onResponderMove.apply(this, arguments); } }, onResponderRelease: (event: SyntheticEvent<>): void => { nullthrows(this.touchableHandleResponderRelease)(event); if (this.props.onResponderRelease != null) { this.props.onResponderRelease.apply(this, arguments); } }, onResponderTerminate: (event: SyntheticEvent<>): void => { nullthrows(this.touchableHandleResponderTerminate)(event); if (this.props.onResponderTerminate != null) { this.props.onResponderTerminate.apply(this, arguments); } }, onResponderTerminationRequest: (): boolean => { const {onResponderTerminationRequest} = this.props; if (!nullthrows(this.touchableHandleResponderTerminationRequest)()) { return false; } if (onResponderTerminationRequest == null) { return true; } return onResponderTerminationRequest(); }, }; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Fulll context
The text was updated successfully, but these errors were encountered: