docs: update setThemeType function

Co-Authored-By: witt <unix.bio@gmail.com>
This commit is contained in:
nocategory
2020-03-29 23:04:49 +01:00
committed by GitHub
parent 06cba32be4
commit 32a854f8c0

View File

@@ -33,7 +33,7 @@ import { CSSBaseline, ZEITUIProvider } from '@zeit-ui/react'
const App = () => {
const [themeType, setThemeType] = useState('dark')
const switchThemes = () => {
setThemeType(themeType === 'dark' ? 'light' : 'dark')
setThemeType(lastThemeType => lastThemeType === 'dark' ? 'light' : 'dark')
}
return (
<ZEITUIProvider theme={{ type: themeType }}>