diff --git a/src/index.d.ts b/src/index.d.ts index 9f041a0f..95b5791b 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -44,7 +44,7 @@ import MenuItem from './components/Menus/MenuItem' import MenuDivider from './components/Menus/MenuDivider' import DropdownMenu from './components/Menus/DropdownMenu' import zIndex from './styles/zIndex' -import { Themer, ThemerContext } from './styles/themer/index' +import { Themer, ThemerContext, ThemerProvider } from './styles/themer/index' import withTheme, { WithThemeInjectedProps } from './styles/themer/withTheme' import Slide from './components/Transitions/Slide' import Grow from './components/Transitions/Grow' @@ -103,6 +103,7 @@ export { // theming Themer, ThemerContext, + ThemerProvider, withTheme, WithThemeInjectedProps, themePropTypes, diff --git a/src/styles/themer/ThemerProvider.d.ts b/src/styles/themer/ThemerProvider.d.ts new file mode 100644 index 00000000..217f0286 --- /dev/null +++ b/src/styles/themer/ThemerProvider.d.ts @@ -0,0 +1,10 @@ +import { Context } from 'react' +import { Themer } from './Themer' +import * as React from 'react' + +export interface ThemerProviderProps { + children?: React.ReactNode + themer: Themer +} + +export declare const ThemerProvider: React.ComponentType diff --git a/src/styles/themer/ThemerProvider.js b/src/styles/themer/ThemerProvider.js index 52aa889e..c66c7211 100644 --- a/src/styles/themer/ThemerProvider.js +++ b/src/styles/themer/ThemerProvider.js @@ -31,8 +31,9 @@ export class ThemerProvider extends React.Component { render() { const { themer, children } = this.props - const { tick } = this.state - return {children} + // this creates a new reference every time render gets called + const themerContext = { themer } + return {children} } } diff --git a/src/styles/themer/index.d.ts b/src/styles/themer/index.d.ts index a0aa1190..484f05ee 100644 --- a/src/styles/themer/index.d.ts +++ b/src/styles/themer/index.d.ts @@ -1,2 +1,3 @@ export { Themer } from './Themer' export { ThemerContext } from './ThemerContext' +export { ThemerProvider } from './ThemerProvider'