Skip to content

Commit

Permalink
Remove dom syncing by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Sep 9, 2024
1 parent 5e814ba commit 4fa14da
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/custom/theme-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ export const useTheme = () => {
const [theme, _setLocalTheme] = React.useState(getTheme());

React.useEffect(() => {
subscribeToTheme((theme) => {
_setLocalTheme(theme)
document.body.setAttribute("data-theme", theme.isDark ? "dark" : 'light')
})
subscribeToTheme((theme) => _setLocalTheme(theme))
}, [])
return { theme, setMode: (_mode: typeof theme['mode']) => setTheme(_mode) }
}
Expand Down

0 comments on commit 4fa14da

Please sign in to comment.