State Update During Toast Dismissal Causes Cannot update a component Error in Dialog Component
aligorgin opened this issue · comments
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
versions:
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021",
"shadcn": "^2.1.6",
"sonner": "^1.7.0",