fix(snippet/tooltip): remove render lvl binding

This commit is contained in:
Rishi Kumar
2018-11-14 01:05:16 +05:30
parent c7df4b2e5c
commit c473dc9e39

View File

@ -35,6 +35,8 @@ class Tooltip extends React.Component {
visibility: "visible" visibility: "visible"
} }
}; };
this.showTooltip = this.toggleTooltip.bind(this, true);
this.hideTooltip = this.toggleTooltip.bind(this, false);
} }
toggleTooltip = tooltipState => { toggleTooltip = tooltipState => {
@ -55,8 +57,8 @@ class Tooltip extends React.Component {
</div> </div>
{React.cloneElement(children, { {React.cloneElement(children, {
...rest, ...rest,
onMouseEnter: () => this.toggleTooltip(true), onMouseEnter: this.showTooltip,
onMouseLeave: () => this.toggleTooltip(false) onMouseLeave: this.hideTooltip
})} })}
</div> </div>
); );