Skip to content

Instantly share code, notes, and snippets.

@arackaf
Last active January 24, 2017 05:42
Show Gist options
  • Select an option

  • Save arackaf/78e23a8bbfc294b2d88994e45f2880d8 to your computer and use it in GitHub Desktop.

Select an option

Save arackaf/78e23a8bbfc294b2d88994e45f2880d8 to your computer and use it in GitHub Desktop.
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