Last active
January 24, 2017 05:42
-
-
Save arackaf/78e23a8bbfc294b2d88994e45f2880d8 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
| const SmartEditor = () => <input placeholder="blah" />; | |
| class PopoverEdit extends Component { | |
| componentDidMount(){ | |
| $(this.anchorEl).popover({ | |
| content(evt){ | |
| let res = document.createElement('div'); | |
| render(<SmartEditor />, res); | |
| return res; | |
| }, | |
| title: 'Edit', | |
| placement: 'top', | |
| html: true | |
| }); | |
| } | |
| componentWillUnmount(){ | |
| $(this.anchorEl).popover('destroy'); | |
| } | |
| render(){ | |
| let {text} = this.props; | |
| return ( | |
| <a ref={el => this.anchorEl = el}>{text}</a> | |
| ) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment