Skip to content

Commit

Permalink
Initialize with prop first (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski authored Jul 10, 2023
1 parent c1f1749 commit 3e2adfb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,9 @@ const Toaster = (props: ToasterProps) => {
const [expanded, setExpanded] = React.useState(false);
const [interacting, setInteracting] = React.useState(false);
const [actualTheme, setActualTheme] = React.useState(
typeof window !== 'undefined'
theme !== 'system'
? theme
: typeof window !== 'undefined'
? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light'
Expand Down

0 comments on commit 3e2adfb

Please sign in to comment.