minutemailer / react-popup

React popup component
http://minutemailer.github.io/react-popup/
MIT License
208 stars 71 forks source link

Error when adding popup to project #49

Closed AllanCodes closed 6 years ago

AllanCodes commented 6 years ago

Hello, I get this error when I add to my index.js file.

Target container is not a DOM element.

ReactDOM.render(<Main />, document.getElementById('root'));
ReactDOM.render(<Popup />, document.getElementById('popupContainer'));

Any ideas what the issue can be? Should I create the element popupContainer somewhere?

tbleckert commented 6 years ago

Do you have an element with the id 'popupContainer' in your HTML?

AllanCodes commented 6 years ago

I've now added popupContainer and get no error, however placing this above my class definition

Popup.alert('Hello'); doesn't do anything. I need mention that my ReactDOM.render is in my index.js file and the Popup.alert() is in another class file

tbleckert commented 6 years ago

You need to style the component, to start with you can use the demo css