question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support multiple <Toaster> elements

See original GitHub issue

This might be outside of the scope for this project, but the ability to have multiple <Toaster> elements on a page (where toast() calls could have a ToasterID passed in) would be pretty cool and add a lot flexibility.

Example:

toast('This appears as a toast relative to the <div> parent', relativeToasterId)
toast('This appears as a normal toast')

...

return (
  <>
    <div>
      <Toaster id={relativeToasterId} />
    </div>

    <Toaster />
  </>
)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
mrmiguucommented, Mar 11, 2022

https://github.com/timolins/react-hot-toast/pull/159 ☝️☝️☝️

This PR, if merged, essentially works like this:

toast('hello', { toasterId: 'unique-id-here' })

...

<Toaster toasterId="unique-id-here" />

This way, only that Toaster will be able to receive toasts to-and-from the string "unique-id-here".

2reactions
timolinscommented, Mar 6, 2022

Hi @mrmiguu! Great suggestion - considered this for v2, but decided not to do it atm.

Let’s use this issue to see how the demand is. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Show multiple toasts in various positions in Angular ...
Checkout and learn about Show multiple toasts in various positions in Angular Toast component of Syncfusion Essential JS 2, and more details.
Read more >
Toaster Troubleshooting - iFixit
Toasting lever won't stay down. When you push down the toasting lever, it pops right back up again, or you have to push...
Read more >
Stan Harrison: Toaster repair project uncovers elements of ...
A quick look inside the two toaster slots revealed the problem. The middle heating element wasn't glowing. Why repair a toaster?
Read more >
Why Your Toaster Will Eventually Fail You | Wirecutter
To help us determine exactly why slot toasters aren't what they used to ... Vintage toasters' heating elements were often made of Nichrome ......
Read more >
How to Repair a Toaster - How to Repair Small Appliances
In many homes, toasters malfunction more than any other small appliance. ... To repair or replace many internal parts, including the heating elements, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found