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

Next.js: page won't load if modal is showing at page load #432

Closed
giraffesyo opened this issue Nov 1, 2020 · 1 comment · Fixed by #433
Closed

Next.js: page won't load if modal is showing at page load #432

giraffesyo opened this issue Nov 1, 2020 · 1 comment · Fixed by #433
Labels

Comments

@giraffesyo
Copy link

Bug report

Thank you very much for the easy to use component. The following isn't an important bug to me, but just letting you know as an FYI because I ran into it while testing.

Describe the bug

Using next.js, if you have the modal open at page load you will get the following error:

Server Error
Error: Target container is not a DOM element.

This error happened while generating the page. Any console logs will be displayed in the terminal window.

To Reproduce

Create a next.js project, use the following hook:

  const [modalIsOpen, setModalIsOpen] = React.useState(true)

And use that state within your modal

<Modal open={modalIsOpen} center onClose={() => setModalIsOpen(false)}>Content</Modal>

Expected behavior

Page loads, with modal open.

System information

  • Version of react-responsive-modal: 5.2.0
  • Version of react: 16.13.1
  • Browser version: Chrome 86
  • Next.js version 10.0.0
@pradel
Copy link
Owner

pradel commented Nov 2, 2020

Thanks for reporting the issue, should be fixed in v5.2.1 :)

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

Successfully merging a pull request may close this issue.

2 participants