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

Is it possible to force a modal to stay mounted? #2160

Closed
isaachinman opened this issue Aug 19, 2016 · 4 comments
Closed

Is it possible to force a modal to stay mounted? #2160

isaachinman opened this issue Aug 19, 2016 · 4 comments

Comments

@isaachinman
Copy link
Contributor

So, I am starting a new application and it's my first time working with react-bootstrap.

The first thing I did was to build a login modal, which uses react-facebook-login and react-google-login. Presumably, both of these components make external API calls upon mounting.

So, I threw these two components into my modal and went along my way. Then I noticed these external Facebook and Google scripts were getting loaded into a page multiple times, because the modal was unmounting and mounting every time it was hidden/shown. To me that seems very counterintuitive; I would expect the markup to remain in place and merely animate it's display/visibility on the open prop.

Regardless, I need a way to produce a modal that mounts once and subsequently hides/shows itself without remounting. Is this possible with react-bootstrap in any capacity? I'd hate to have to go back to material-ui just for a modal.

@taion
Copy link
Member

taion commented Aug 19, 2016

Disable unmountOnExit. Generally modals are supposed to unmount when hidden though.

@taion taion closed this as completed Aug 19, 2016
@isaachinman
Copy link
Contributor Author

@taion That prop does nothing for the modal component. I see it in the docs for tabs, though.

@0horaa
Copy link

0horaa commented Mar 20, 2023

Any update? I have the same need.

@artygrand
Copy link

artygrand commented Feb 22, 2024

We really need keepMounted prop for temporary hidden modal to persist inner state

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

4 participants