emilkowalski / sonner

An opinionated toast component for React.
https://sonner.emilkowal.ski
MIT License
8.73k stars 278 forks source link

`<Toaster/>` container not reactive for props `theme` #100

Closed Innei closed 1 year ago

Innei commented 1 year ago

If I write this code, I want to change the theme.

export const SonnerContainer = () => {
  const isDark = useIsDark()
  return (
    <Toaster
      richColors
      closeButton
      duration={6666}
      theme={isDark ? 'dark' : 'light'}
    />
  )
}

But props theme is not reactive.

https://github.com/emilkowalski/sonner/blob/main/src/index.tsx#L385

emilkowalski commented 1 year ago

This has been fixed in #103. You can update to the latest version to have it working again