emilkowalski / sonner

An opinionated toast component for React.

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSX returning translations change toast styling

jimmailcamp opened this issue Β· comments

Describe the feature / bug πŸ“:

When using a component to return the message, which is often the case because I'm using i18n translation components quite often, the styling of the toasts change. For example, the default icon on success or info dissapears and the fontweight changes.

yes I understand the solution is to return a string, but in this specific case that's NOT possible in certain scenarios due to invalid hook calls outside of components.

Steps to reproduce the bug πŸ”:

  1. Create a tsx component that returns a string in a fragment.
  2. toast.success();
  3. Styling is different from when passing plain string