diff --git a/native/tooltip/nux-tips-overlay.react.js b/native/tooltip/nux-tips-overlay.react.js --- a/native/tooltip/nux-tips-overlay.react.js +++ b/native/tooltip/nux-tips-overlay.react.js @@ -85,6 +85,7 @@ +closeTip: () => mixed, +contentContainerStyle: ViewStyle, +opacityStyle: AnimatedViewStyle, + +buttonStyle: ViewStyle, }; function createNUXTipsOverlay( @@ -143,18 +144,6 @@ ); } - get buttonStyle(): ViewStyle { - const { params } = this.props.route; - const { initialCoordinates, verticalBounds } = params; - const { x, y, width, height } = initialCoordinates; - return { - width: Math.ceil(width), - height: Math.ceil(height), - marginTop: y - verticalBounds.y, - marginLeft: x, - }; - } - get tipContainerStyle(): AnimatedViewStyle { const { dimensions, route } = this.props; const { initialCoordinates, verticalBounds } = route.params; @@ -197,6 +186,7 @@ closeTip, contentContainerStyle, opacityStyle, + buttonStyle, ...navAndRouteForFlow } = this.props; @@ -244,7 +234,7 @@ - + @@ -307,6 +297,17 @@ }; }, [position, styles.backdrop]); + const buttonStyle = React.useMemo(() => { + const { initialCoordinates, verticalBounds } = props.route.params; + const { x, y, width, height } = initialCoordinates; + return { + width: Math.ceil(width), + height: Math.ceil(height), + marginTop: y - verticalBounds.y, + marginLeft: x, + }; + }, [props.route.params]); + return ( ); }