Replies: 1 comment
-
You need to specify type in use-local-storage hook: const [colorScheme, setColorScheme] = useLocalStorageValue<'light | 'dark>({
key: 'mantine-color-scheme',
defaultValue: 'light',
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When implementing the example 'Save to localStorage and add keyboard shortcut' under 'Dark theme' in the docs, the following statement throws the error
this condition will always return 'false' since the types '"light"' and '"dark"' have no overlap.
setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark'));
Beta Was this translation helpful? Give feedback.
All reactions