You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'd like to add a story of my Modal component which is made by ReactDOM.createPortal .
the modal container is <div id="modal-root"></div> added by me in index.html .
but when I write story like this:
Since the const modalRoot = document.getElementById('modal-root') is called statically, you need to generate the <div id="modal-root"> before the Modal component is imported. I can suggest creating this div in config.js before loading the stories.
Describe the bug
I'd like to add a story of my Modal component which is made by ReactDOM.createPortal .
the modal container is
<div id="modal-root"></div>
added by me in index.html .but when I write story like this:
「Target container is not a DOM element」error happened.
I think it's because there is no modal-root div in Storybook UI?
How can I fix it?
To Reproduce
see above
Screenshots
Code snippets
this is my Modal code for short:
System:
The text was updated successfully, but these errors were encountered: