Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

ThemeContext.ts

10 lines259 Bytes

1import { createContext, useContext } from 'solid-js'
2import type { Accessor } from 'solid-js'
3​
4export const ThemeContext = createContext<Accessor<'light' | 'dark'>>(
5 () => 'dark' as const,
6)
7​
8export function useTheme() {
9 return useContext(ThemeContext)