TypeScript returns a type error about ToastOptions.icon
See original GitHub issueType Script returns a type error in following codes:
const toast = Vue.toasted.error(msg, {
...
icon: 'mdi mdi-alert'
...
});
Error message: Types of property ‘icon’ are incompatible.
It seems that definitions need to be changed as below:
(-) icon?: (ToastIcon: HTMLElement) => HTMLElement | string | { name: string, after: boolean },
(+) icon?: ((ToastIcon: HTMLElement) => HTMLElement) | string | { name: string, after: boolean },
Please check changes of the commit a03cc406b1a75acbcb14c3ee0ed9d3da25c68a0a
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:14
- Comments:6
Top Results From Across the Web
TypeScript returns a type error about ToastOptions.icon -
Type Script returns a type error in following codes: const toast = Vue.toasted.error(msg, { ... icon: 'mdi mdi-alert' ... }); Error message: Types...
Read more >How do you access and declare the types of a react component?
You can declare a type for what the function returns, a ReturnType . it looks like this const yourFunction = (props: PropType): ReturnType ......
Read more >Documentation - Do's and Don'ts - TypeScript
Don't ever use the types Number , String , Boolean , Symbol , or Object These ... doSomething(); // error, but would be...
Read more >@types/native-toast - npm
@types/native-toast. TypeScript icon, indicating that this package has built-in type declarations. 2.0.2 • Public • Published a year ago.
Read more >toast() API
You can provide ToastOptions as the second argument. ... Creates a notification with an animated error icon. ... Each toast call returns a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shakee93 Can you release changes ?
We’ve gone ahead and just installed the git repo directly for the meantime. (The compiled code is included in the GitHub repo.)
npm i git+https://github.com/shakee93/vue-toasted.git