Skip to content

Commit

Permalink
don't set default value in theme context, as it doesn't update proper…
Browse files Browse the repository at this point in the history
…ly with override values
  • Loading branch information
mmalfertheiner committed Aug 20, 2021
1 parent 401dbe4 commit a9858ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/framework/theme/ThemeContext.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createContext, useContext } from 'react'
import { defaultTheme, Theme } from './theme'
import { Theme } from './theme'

export const ThemeContext = createContext<Theme>(defaultTheme)
export const ThemeContext = createContext<Theme | undefined>(undefined)

export function useTheme(): Theme {
const theme = useContext(ThemeContext)

if (theme === null) {
if (theme === null || theme === undefined) {
throw new Error('No theme available on context')
}

Expand Down

0 comments on commit a9858ea

Please sign in to comment.