react-portal-tooltip
react-portal-tooltip copied to clipboard
Using Callback Refs for parent property
I am not able to set parent element using React Callback Refs
setReactionsRef = (element) => {
this.element = element;
}
<div
onMouseEnter={this.showReactions}
onMouseLeave={this.hideReactions}
ref={this.setReactionsRef}
>
{'Hello World'}
</div>
<ToolTip
active={this.state.showReactions}
position='top'
parent={this.element}
tooltipTimeout={500}
>
{'Hello World'}
</ToolTip>
The error that i am getting is as follows
Failed prop type: The prop `parent` is marked as required in `ToolTip`, but its value is `undefined`.