mirror of
https://github.com/D4M13N-D3V/neroshitron.git
synced 2025-03-14 10:05:04 +00:00
19 lines
523 B
TypeScript
19 lines
523 B
TypeScript
|
import { useState } from 'react'
|
||
|
|
||
|
import { Button, useIsomorphicLayoutEffect } from 'tamagui'
|
||
|
|
||
|
import { useThemeSetting } from '@tamagui/next-theme'
|
||
|
export default function Home() {
|
||
|
|
||
|
const themeSetting = useThemeSetting()
|
||
|
|
||
|
const [clientTheme, setClientTheme] = useState<string>('dark')
|
||
|
useIsomorphicLayoutEffect(() => {
|
||
|
|
||
|
setClientTheme(themeSetting.current || 'dark')
|
||
|
|
||
|
}, [themeSetting.current, themeSetting.resolvedTheme])
|
||
|
return <Button onPress={themeSetting.toggle}>Change theme: {clientTheme}</Button>
|
||
|
|
||
|
}
|