react-portal-tooltip icon indicating copy to clipboard operation
react-portal-tooltip copied to clipboard

Using Callback Refs for parent property

Open khawerrind opened this issue 6 years ago • 0 comments

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`.

khawerrind avatar Dec 27 '18 18:12 khawerrind