@@ -33,10 +33,11 @@ const parseProps = props => {
33
33
export const jsx : typeof React . createElement = ( type , props , ...children ) =>
34
34
emotion . apply ( undefined , [ type , parseProps ( props ) , ...children ] )
35
35
36
- export const Context = React . createContext < {
36
+ export interface ContextValue {
37
37
__EMOTION_VERSION__ : string
38
38
theme : Theme | null
39
- } > ( {
39
+ }
40
+ export const Context = React . createContext < ContextValue > ( {
40
41
__EMOTION_VERSION__ ,
41
42
theme : null ,
42
43
} )
@@ -64,7 +65,10 @@ export const merge = (a, b) =>
64
65
65
66
merge . all = ( ...args ) => deepmerge . all ( args , { isMergeableObject, arrayMerge } )
66
67
67
- const BaseProvider = ( { context, children } ) =>
68
+ interface BaseProviderProps {
69
+ context : ContextValue
70
+ }
71
+ const BaseProvider : React . FC < BaseProviderProps > = ( { context, children } ) =>
68
72
jsx (
69
73
EmotionContext . Provider ,
70
74
{ value : context . theme } ,
@@ -97,8 +101,5 @@ export function ThemeProvider({ theme, children }: ThemeProviderProps) {
97
101
? { ...outer , theme : theme ( outer . theme ) }
98
102
: merge . all ( { } , outer , { theme } )
99
103
100
- return jsx ( BaseProvider , {
101
- context,
102
- children,
103
- } )
104
+ return jsx ( BaseProvider , { context } , children )
104
105
}
0 commit comments