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 @@ -86,6 +86,7 @@ +overlayContext: ?OverlayContextType, +styles: $ReadOnly, +closeTip: () => mixed, + +contentContainerStyle: ViewStyle, }; function createNUXTipsOverlay( @@ -159,19 +160,6 @@ }; } - get contentContainerStyle(): ViewStyle { - const { verticalBounds } = this.props.route.params; - const fullScreenHeight = this.props.dimensions.height; - const top = verticalBounds.y; - const bottom = - fullScreenHeight - verticalBounds.y - verticalBounds.height; - return { - ...this.props.styles.contentContainer, - marginTop: top, - marginBottom: bottom, - }; - } - get buttonStyle(): ViewStyle { const { params } = this.props.route; const { initialCoordinates, verticalBounds } = params; @@ -224,6 +212,7 @@ overlayContext, styles, closeTip, + contentContainerStyle, ...navAndRouteForFlow } = this.props; @@ -273,7 +262,7 @@ - + @@ -310,6 +299,19 @@ const styles = useStyles(unboundStyles); + const contentContainerStyle = React.useMemo(() => { + const { verticalBounds } = props.route.params; + const fullScreenHeight = dimensions.height; + const top = verticalBounds.y; + const bottom = + fullScreenHeight - verticalBounds.y - verticalBounds.height; + return { + ...styles.contentContainer, + marginTop: top, + marginBottom: bottom, + }; + }, [dimensions.height, props.route.params, styles.contentContainer]); + return ( ); }