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

Uncaught Error: react-modal: You must set an element with Modal.setAppElement(el) #267

Closed
petrdamborsky opened this issue Nov 24, 2016 · 4 comments

Comments

@petrdamborsky
Copy link

Summary:

Just wanted to try this modal solution. Docs mention the setAppElement as an optional thing to do, but I am getting this error in console when I do not call it. I Have tried to call the Modal.setAppElement from the component itself and then also from the root app component. No place does help to get rid of this error.

Steps to reproduce:

  1. Create new component using Modal inside
  2. Use the component in app
  3. Get console error

Expected behavior:

I would expect not to be forced into setAppElement.

Additional notes:

@diasbruno
Copy link
Collaborator

@petrdamborsky yeah, you can't call setAppElement within the modal itself. It should be appended to document.body as default, if I'm correct. I'll check it.

@diasbruno
Copy link
Collaborator

@petrdamborsky since this issue is a bit old (sorry), did you found a way to make it work?

@petrdamborsky
Copy link
Author

@diasbruno Hey, sorry I missed the notification. I have actually moved on and found different package with modals.

Oh and I was trying the setAppElement from the root component, not the modal itself.. still didn't work. Not sure what was wrong, but I won't be able to get back to that state now :)

@diasbruno
Copy link
Collaborator

that's ok.
thanks, @petrdamborsky.

dminuoso pushed a commit to dminuoso/react-bootstrap-table that referenced this issue Mar 14, 2017
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

2 participants