mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Update typo in docs
This commit is contained in:
parent
1af805e5d4
commit
0ef5bcaa12
@ -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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user