Skip to content
New issue

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

childrenProps property #148

Open
darkerthanblackoff opened this issue Apr 13, 2022 · 1 comment
Open

childrenProps property #148

darkerthanblackoff opened this issue Apr 13, 2022 · 1 comment

Comments

@darkerthanblackoff
Copy link

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.

@apfritts
Copy link

apfritts commented May 5, 2022

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>
  )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants