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

Fix conditional rendering in ModalStack component #1731

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Huderon
Copy link
Contributor

@Huderon Huderon commented Mar 28, 2024

Sorry for another single line PR. I kept seeing it in screenshots, though, and it was triggering me

@rauenzi
Copy link
Member

rauenzi commented Mar 28, 2024

Eh? What screenshots?

@Huderon
Copy link
Contributor Author

Huderon commented Mar 28, 2024

Eh? What screenshots?

These ones. Mostly from Skye and Sarah, I believe. image-8.png

image-7.png

image-6.png

image-5.png

image-4.png

@CalebBarnes
Copy link

CalebBarnes commented May 8, 2024

Looks good. The issue was the modals.length && check will just return 0 if the check doesn't pass. Forcing it to be a boolean with !! is a valid fix.

{modals.length && <ModalLayer />}

You can also explicitly return null in cases like this:

{modals.length ? <ModalLayer /> : null}

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

Successfully merging this pull request may close these issues.

None yet

3 participants