the div exists?
Update your index.html file adding a div in the body tag as: <div id="main"></div> and then rename the div inside your Layout component to have some other id (so that there's only one "main" id div which is already in index.html file). The Modal should be rendered with Portal now.
ok got it, seems working now but the modal not appear
I have </Modal.Body> </Modal>, document.querySelector(".main")
I wanna help further, but we keep rotating on the same issue here, don't know exactly what you're doing here because you're only giving me one/two statement out of the context from your file. IF you need further help, put it somewhere online, like StackBlitz/GitHub, anywhere and share files or screenshots.
the problem is that the modal doesn't show inside the main container
If you inspect the page and look into DOM tree, I am sure you'll find that the Modal DOM tree is inside the main container DOM element. It doesn't show inside the main container in the page? Use CSS to style your Modal, man.. Your modal probably has an overlay and a container with position fixed stretching all over the page.
Обсуждают сегодня