react-native-walkthrough-tooltip icon indicating copy to clipboard operation
react-native-walkthrough-tooltip copied to clipboard

childrenProps property

Open darkerthanblackoff opened this issue 2 years ago • 1 comments

Sometimes it becomes necessary to change the appearance of child components when they are rendered on top of the overlay. For example, I wrapped an icon with black text in a tooltip, the text will be hard to see because of the overlay and I need the ability to change it to white only when the tooltip is visible. Can you add something like childrenProps property? Also it will be grate if it will work with array of child components, because sometimes it's need to wrap more than one component.

darkerthanblackoff avatar Apr 13 '22 17:04 darkerthanblackoff

Have you tried using TooltipChildrenContext?

import {TooltipChildrenContext} from 'react-native-walkthrough-tooltip'

...

render() {
  return (
    <TooltipChildrenContext.Consumer>
      {({tooltipDuplicate}) => (
          <View>
            <Text>Is child? {tooltipDuplicate ? 'yes' : 'no'}</Text>
          </View>
        )
      }
    </TooltipChildrenContext.Consumer>
  )
}

apfritts avatar May 05 '22 15:05 apfritts