Created
August 20, 2016 11:07
-
-
Save narqo/59a091b7a0ec04f09b9ee5346c7f5671 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Popup from 'popup'; | |
class Tooltip extends Component { | |
render() { | |
return ( | |
<Popup visible={this.props.visible} anchor={this.props.anchor} onRequestHide={this.onPopupRequestHide}> | |
<div onMouseEnter={this.onPopupMouseEnter} onMouseLeave={this.onPopupMouseLeave}> | |
{this.props.children} | |
</div> | |
</Popup> | |
); | |
} | |
onPopupMouseEnter() { | |
this.stopTimer(); | |
} | |
onPopupMouseLeave() { | |
this.startTimer(); | |
} | |
onPopupRequestHide() { | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment