Merge pull request #1731 from Huderon/main

Fix conditional rendering in ModalStack component
This commit is contained in:
Zerebos 2024-08-29 20:26:42 -04:00 committed by GitHub
commit b34a348dd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -71,6 +71,6 @@ export default function ModalStack() {
return <TransitionGroup component={Fragment}>
<Backdrop isVisible={!!modals.length} onClick={() => removeModal(modals[modals.length - 1].modalKey)} />
{modals.length && <ModalLayer key={modals[modals.length - 1].modalKey} {...modals[modals.length - 1]} onClose={() => removeModal(modals[modals.length - 1].modalKey)} />}
{!!modals.length && <ModalLayer key={modals[modals.length - 1].modalKey} {...modals[modals.length - 1]} onClose={() => removeModal(modals[modals.length - 1].modalKey)} />}
</TransitionGroup>;
}