setAppElement from react-modal
See original GitHub issueHi everybody,
I have integrated react-image-lightbox however I have the following error message: “Uncaught Error: react-modal: You must set an element with Modal.setAppElement(el)
to make this accessible”
Anyone know how could I fix it? I am using “react-modal”: “^1.3.0” dependency.
Thanks a lot for your help.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
setAppElement - react-modal documentation
This example shows how to use setAppElement to properly hide your application from screenreaders and other assistive technologies while the modal is open....
Read more >"Warning: react-modal: App element is not defined. Please ...
Some solutions are given in react-modal issue #133: ... setAppElement() is called with null or not called at all with the <script />...
Read more >Error: You must set an element with `Modal.setAppElement(el ...
react -modal was trying to set the app element to document.body , while it doesn't exist yet. If you did the same, within...
Read more >React Modal - Using setAppElement - CodePen
1. ReactModal.setAppElement('#main'); ; 2. ; 3. class ExampleApp extends React.Component { ; 4. constructor () { ; 5. super();.
Read more >[Resolved] Warning: react-modal: App element is not defined ...
setAppElement (el)` or set `appElement={el}`. November 13, 2022. When using the react-modal package component, we see a Warning message in the console saying ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue. This is a known bug in
react-modal
: https://github.com/reactjs/react-modal/issues/133 The workaround helped, but sincereact-image-lightbox
relies onreact-modal
and calls it implicitly, it isn’t just a “react-modal usage issue”, it is areact-image-lightbox
issue too.I experienced this issue using webpack. More details on this issue https://github.com/reactjs/react-modal/issues/133
I worked around it by adding
Full example