Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sandbox Example Please #170

Open
m-o-leary opened this issue Mar 17, 2018 · 2 comments
Open

Sandbox Example Please #170

m-o-leary opened this issue Mar 17, 2018 · 2 comments

Comments

@m-o-leary
Copy link

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

@ericettensohn
Copy link

ericettensohn commented Mar 25, 2018

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;

@jake-nz
Copy link

jake-nz commented Apr 12, 2018

createPortal was introduced in React 16. You might be running 15 or lower.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants