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