How to use the theming.themeListener.initial function in theming

To help you get started, we’ve selected a few theming examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / theming / theming-tests.tsx View on Github external
constructor(props: P, context: ContextWithTheme) {
      super(props, context);
      this.state = { theme: themeListener.initial(context) };
    }
    componentDidMount() {
github cssinjs / styled-jss / src / styled.js View on Github external
constructor(props: StyledElementPropsType, context: any) {
      super(props, context)

      if (!this.dynamicTagName && dynamicStyle) {
        this.dynamicTagName = availableDynamicTagNames.pop() || generateTagName(tagName)
      }

      this.state = {}

      if (context[channel]) {
        this.state.theme = themeListener.initial(context)
      }

      this.staticClassName = staticClassName
    }