Closed khromov closed 1 year ago
I see now that the types seem to differ between my local environment and on GitHub. On GitHub the types are:
error: ValueOrFunction<Renderable, any>;
As per here.
But in my local project, the types look like this:
promise<T>(promise: Promise<T>, msgs: {
loading: Renderable;
success: Renderable;
error: Renderable;
}, opts?: DefaultToastOptions | undefined): Promise<T>;
So it makes sense that it wouldn't work. Perhaps the Types need to be updated in the NPM version?
Looks like this was fixed in the 1.0.4
beta but because of the beta status my NPM wasn't picking up the new version. If you have the same issue you can run npm i svelte-french-toast@1.0.4-beta.0 --save
and it should fix the types.
@khromov Thanks a lot for flagging and resolving the issue! Let me know if the beta version's working for you. I'll promote it to stable soon.
I have some code that looks like this:
The code works, however I get the TS error:
I tried typing this in various ways, but I can't figure out how to get it to work. For example both of these examples do not work either: