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

Chakra Toasts can be rendered multiple times #45

Open
mbeckem opened this issue Feb 13, 2023 · 0 comments
Open

Chakra Toasts can be rendered multiple times #45

mbeckem opened this issue Feb 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@mbeckem
Copy link
Contributor

mbeckem commented Feb 13, 2023

Reproduction:

  • Use multiple apps (or multiple instances of the same app) in a single html site
  • Emit toasts in one of the apps (chakra's useToast(...))

Expected behavior:

  • Toasts are rendered exactly once in the page

Actual behavior:

  • Every toast is rendered multiple times (once in every app instance).

Analysis:

  • Chakra uses a global store (in @chakra-ui/toast/toastStore) to manage toasts
  • All applications render all toasts
  • We either have to define that toasts are rendered locally (only for the "current" app) or globally in a shared container between all apps
@mbeckem mbeckem added the bug Something isn't working label Feb 13, 2023
@mbeckem mbeckem transferred this issue from open-pioneer/trails-starter Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant