license import React from 'react' ; import { ThemeContext } from './themeContext' ; import { ThemeService , ThemeType , } from './theme.service' ; export interface ThemeProviderProps { theme : ThemeType ; children ? : React . ReactNode ; } overview-example export class ThemeProvider extends React . PureComponent < ThemeProviderProps > { public render ( ) { const { theme , children } = this . props ; return ( < ThemeContext . Provider value = { ThemeService . create ( theme ) } > { children } < /ThemeContext.Provider>); } }