AndreiCalazans / rn-tooltip

A <Tooltip /> component for React Native
MIT License
328 stars 75 forks source link

Closing manually the tooltip #56

Closed jcyusicastro closed 4 years ago

jcyusicastro commented 4 years ago

Is there a way to close the tooltip using a function inside the popOver component? I want to close the tooltip after a press a button inside it.

AndreiCalazans commented 4 years ago

Yes. Get a ref to the tooltip and call the toggle https://github.com/AndreiCalazans/rn-tooltip/blob/master/src/Tooltip.js#L57

ShelbyIB commented 1 year ago

`<Tooltip // eslint-disable-next-line no-return-assign ref={(ref) => (tooltipRef.current = ref)} height={null} width={320} withOverlay={false} pointerStyle={Platform.OS === 'ios' ? styles.pointerStyleIos : styles.pointerStyleAndroid} containerStyle={styles.containerStyle} popover={ <WhatIsBlastTooltip onPressButtonOK={() => tooltipRef.current.toggleTooltip()} /> } backgroundColor={COLORS.white}

`