Skip to content

Commit

Permalink
Added parentWrapperStyle prop that can be used to control the style o…
Browse files Browse the repository at this point in the history
…f the view rapper surrounding the original children
  • Loading branch information
Saikedo committed Jan 9, 2022
1 parent 054506f commit 5f5e6f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/tooltip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ declare module 'react-native-walkthrough-tooltip' {

// Styles the View element that wraps the children to clone it
childrenWrapperStyle?: StyleProp<ViewStyle>;

// Styles the view element that wraps the original children
parentWrapperStyle?: StyleProp<ViewStyle>
}

export interface TooltipProps extends Partial<TooltipStyleProps> {
Expand Down
6 changes: 5 additions & 1 deletion src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,11 @@ class Tooltip extends Component {

{/* This renders the child element in place in the parent's layout */}
{hasChildren ? (
<View ref={this.childWrapper} onLayout={this.measureChildRect}>
<View
ref={this.childWrapper}
onLayout={this.measureChildRect}
style={this.props.parentWrapperStyle}
>
{children}
</View>
) : null}
Expand Down

0 comments on commit 5f5e6f6

Please sign in to comment.