import * as React from 'react' ; import deepmerge from 'deepmerge' ; import { Theme } from '../styles/defaultTheme' ; interface Props { theme : Theme ; } function createThemeProvider ( defaultTheme , ThemeContext ) { const ThemeProvider = ( props ) => { return ( < ThemeContext . Provider value = { deepmerge ( defaultTheme , props . theme ) } > { props . children } < /ThemeContext.Provider>); } ; return ThemeProvider ; } export default createThemeProvider ;