-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add "props" to the toast options. #48
Conversation
… toast message component.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…as the type for props.
Just noticed that it solves #33. A good point was brought up there that it would be very cool and important to have the props be type safe, this 3rd commit should solve that. |
I also took off the @typescript-eslint/no-explicit-any warning because I used Record<string, any> which is used in the SvelteComponent
This would be incredibly useful! Hopefully, can this be merged soon. I need it in my project. |
Thanks for this PR! Is it backwards compatible or is it a breaking change? Two notes:
Happy to merge after these changes. |
Sounds good! I think good to go, let me know if there is anything else! Thanks - 🙏 |
@kbrgl - This is awesome, could you please publish this release? |
@kbrgl Yeah, kind of confusing. It's in the docs because it's in master but you can't use it because there is no release :) |
impl of toast func was needed as a workaround because there's no way to safely pass props to toasts in this version of svelte-french-toast, it's supposed to be coming in a new version: kbrgl/svelte-french-toast#48
@kbrgl thanks for the great work! Could you bumb the release version to 1.3.0 and build the dist so that we can use these last features ? |
Proposal to allow props to be passed into Toast Options and then passed into Renderable Svelte Component.
TLDR;
Custom toast component:
Using this component:
I think a better solution is to add props to Toast Options, see example above.
Typescript
A note here that
toast(Toast)
now infers the props coming from the Toast component, and then yourprops: { }
are type safe based on the props in the Toast component.