Update typo in docs

This commit is contained in:
Zai Shi 2024-09-16 00:44:03 +02:00 committed by GitHub
parent 1af805e5d4
commit 0ef5bcaa12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,17 +32,16 @@ Here is an example of how to set up next-themes with Stack (find more details in
```jsx
'use client';
import { Button } from '@stackframe/stack'
import { useTheme } from 'next-themes'
export default function ColorModeSwitcher() {
const { theme, setTheme } = useTheme()
return (
<Button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>
<button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>
Toggle theme
</Button>
</button>
)
}
```
Now if you put the `ColorModeSwitcher` component in your app, you should be able to switch between light and dark mode. There should be no flickering or re-rendering of the page after reloading.
Now if you put the `ColorModeSwitcher` component in your app, you should be able to switch between light and dark mode. There should be no flickering or re-rendering of the page after reloading.