kovakmedya add2317717 fix(ui): add 'use client' to sonner Toaster and chart components
Both files use client-only hooks (useTheme in sonner; useState/useMemo/
useId in chart via React) but the shadcn CLI shipped them without the
'use client' directive. Mounting <Toaster /> in the root server layout
crashed in production with:
  Attempted to call useTheme() from the server but useTheme is on the
  client.

Same risk on chart.tsx once any dashboard page renders <Chart>.

Verified all of src/components/ui/*.tsx — only these two needed the fix.
Future shadcn additions: check 'head -1' for the directive before
importing into server components.
2026-04-30 05:52:08 +03:00
S
Description
No description provided
5.2 MiB
Languages
TypeScript 99.5%
CSS 0.5%