emilkowalski / sonner

An opinionated toast component for React.

Home Page:https://sonner.emilkowal.ski

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom `loadingIcon` inherits `toast` classes even though it is rendered inside one

samlaycock opened this issue · comments

Looking at the code, I'm not sure if this is intentional or not..?:

className={cn('loader', classNames?.toast, toast?.classNames?.toast)}

It means that the custom loadingIcon is rendered with the toast's classes, which causes a double rendering of styles (background, shadows etc.). I think it would be better if the loadingIcon prop was completely agnostic to any other external styles, as you've already opted into rendering the loading component yourself entirely anyway?

Example:

Screenshot 2023-12-25 at 10 18 33

Good catch, fixed in #268