iamhosseindhv / notistack

Highly customizable notification snackbars (toasts) that can be stacked on top of each other
https://notistack.com
Other
3.9k stars 299 forks source link

fix: Omit content from SharedProps to resolve type incompatibility with @types/react v18.2.x+ #574

Closed katsuya closed 5 months ago

katsuya commented 1 year ago

Due to the changes in @types/react, the type of content in HTMLAttributes has been modified. This has caused the following error to occur in versions of @types/react v18.2.x and later. I've made adjustments by omitting content.

../node_modules/notistack/dist/index.d.ts(174,18): error TS2430: Interface 'SharedProps' incorrectly extends interface 'Omit<SnackbarProps, "classes">'.
  Types of property 'content' are incompatible.
    Type 'SnackbarContentCallback' is not assignable to type 'string | undefined'.
      Type 'null' is not assignable to type 'string | undefined'.
AdedigbaOluwad1 commented 1 year ago

Guys merge this fix on time please! I had to edit my node modules so my application could build successfully! This is the third time 😭😭