react-popover
react-popover copied to clipboard
Sandbox Example Please
Could you please put an example in the readme of how to get this running from scratch?
it's very confusing to have to backtrack through all the story code to try and get a basic popover up and running.
The reason I ask is I am getting _reactDom2.default.createPortal is not a function
error and I have no idea why but I'm sure it's my understanding of how to get setup.
Thanks
I'm getting this error as well. Component:
import * as React from 'react';
import Popover from 'react-popover'
class ReportTile extends React.Component<{ name: string }, { isOpen: boolean }> {
constructor(props) {
super(props);
this.state = {
isOpen: false
}
}
togglePopover = () => {
this.setState({ isOpen: !this.state.isOpen })
}
render() {
return (
<div>
<Popover
body={
<p>test3</p>
}
isOpen={this.state.isOpen}
onOuterAction={this.togglePopover}
>
<div onClick={this.togglePopover} className='report-tile'>
<h5 className='report-name'>{this.props.name}</h5>
</div>
</Popover>
</div>
)
}
}
export default ReportTile;
createPortal
was introduced in React 16. You might be running 15 or lower.