emilkowalski / sonner

An opinionated toast component for React.

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

Repository from Github https://github.comemilkowalski/sonnerRepository from Github https://github.comemilkowalski/sonner

State Update During Toast Dismissal Causes Cannot update a component Error in Dialog Component

aligorgin opened this issue · comments

commented

When dismissing a toast (e.g., toast.error) in a component using Sonner Toasts and ShadCN Dialog, the application throws the following error:

hook.js:608 Cannot update a component (ForwardRef) while rendering a different component (ForwardRef). To locate the bad setState() call inside ForwardRef, follow the stack trace as described in https://react.dev/link/setstate-in-render Error Component Stack

Screenshot 1403-09-18 at 12 07 46
Screenshot 1403-09-18 at 12 08 52

versions:
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021",
"shadcn": "^2.1.6",
"sonner": "^1.7.0",