Skip to content

Commit

Permalink
fix: manually type ThemeProvider to fix type errors (pacocoursey#263)
Browse files Browse the repository at this point in the history
* fix: manually type ThemeProvider to fix type errors

* Update next-themes/src/index.tsx

---------

Co-authored-by: paco <34928425+pacocoursey@users.noreply.github.com>
  • Loading branch information
BlankParticle and pacocoursey authored Mar 13, 2024
1 parent 9d05205 commit 709952d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion next-themes/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const defaultContext: UseThemeProps = { setTheme: _ => {}, themes: [] }

export const useTheme = () => React.useContext(ThemeContext) ?? defaultContext

export const ThemeProvider = (props: ThemeProviderProps) => {
export const ThemeProvider = (props: ThemeProviderProps): React.ReactNode => {
const context = React.useContext(ThemeContext)

// Ignore nested context providers, just passthrough children
Expand Down

0 comments on commit 709952d

Please sign in to comment.