Open mrmiguu opened 2 years ago
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. 👍
This would be super helpful.
Please, consider, would be amazing feature
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 toast
s to-and-from the string "unique-id-here"
.
looking forward to having this!
hi all, how about this
This would be an extremely valuable feature! Please consider adding.
Yeah. That is what we need right now. For now we will have to support a different functionality with the same behavior.
My guess is that this doesn't use React Context yet.
If there could be something like a <ToastProvider>
, you could use that multiple times and even nest them, where the innermost provider determines which one should be used. That could be really useful if you have one for general app messages, and another one inside of a sidebar or something like that.
I also noticed that it doesn't work out-of-the-box when you have a component library (in a different package) and want to toast things from there to the main app. A context could make that really easy, but for now I just passed the toast()
function to our own context and retrieve it from there rather than importing it.
Any updates on this?
pls ser?
This would be an extremely valuable feature!
+1, would definitely be helpful. Having to do some workarounds right now to get toasts to work with headless UI dialogs.
Please consider this feature :)
This would be a great feature,hands down
would love to have this feature as well
+1 I need some toasts to overlay on my video player
Any news? It would be a great feature.
Any news? It would be a great feature.
Just wanted to add my interest in this feature
need this too
Any news on this? Been a while, would be an amazing feature to have 🤌
I think the owner is not quite available to manage the repo, we have many pending pull requests, few months ago I was needing a feature, I sent a pull request and it's still pending, so I've forked the repo, implemented the feature that I was needing, and sent to NPM, temporary solution.
This might be outside of the scope for this project, but the ability to have multiple
<Toaster>
elements on a page (wheretoast()
calls could have aToasterID
passed in) would be pretty cool and add a lot flexibility.Example: