Open MetaBenji opened 1 year ago
same here . need a type safe please.
@calintamas, I think we can close this issue because we added different types of toast.
@seyedmostafahasani I'd keep it open for now, the issue refers to custom toast types and custom props, for which indeed, there is no type safety.
This would be nice. In the meantime, what I did was create a class what wrapped the original toast calls and added my default configs and custom methods to it. It ended up pretty nice to use and maintain, similar to the Sonner API.
You still don't have type safety on the private show method, but all the code is right there, and you call your own class where you need it, specifying what you want.
Is your feature request related to a problem? Please describe.
Is there currently a way to get type safety when calling
Toast.show
with a custom component. I want to enforce the correct props being passed to my custom toast componentDescribe the solution you'd like
Type safety
Describe alternatives you've considered
I haven't thought of any alternatives
Additional context