getTheme(passedTheme) {
    const theme = passedTheme || this.props.theme
    if (isFunction(theme)) {
      const mergedTheme = theme(this.outerTheme)
      if (!isPlainObject(mergedTheme)) {
        throw new Error(
          '[ThemeProvider] Please return an object from your theme function, ' +
            'i.e. theme={() => ({})}!',
        )
      }
      return mergedTheme
    }
    return {...this.outerTheme, ...theme}
  }
This is a component which will provide a theme to the entire tree
via context and event listener
(because pure components block context updates)
inspired by the styled-components implementation
https://github.com/styled-components/styled-components
@param {Object} theme the theme object..