Open Azq2 opened 3 months ago
Encountered the same issue just recently. Basically you don't need to use createMemo for theme variable. Below is the code that worked for me.
const palette = createMemo(() => {
return createPalette(mode() === 'light' ? light : dark)
})
const theme = createTheme({ palette })
<ThemeProvider theme={theme}></...>
yet you can read this to see more details about it.
I see
console.log('prefersDarkMode=', prefersDarkMode());
on the console, but the theme is not changed.