Skip to content
This repository was archived by the owner on Jul 11, 2019. It is now read-only.
This repository was archived by the owner on Jul 11, 2019. It is now read-only.

react-stampit with material-ui #37

@gavriguy

Description

@gavriguy

I'm trying to implement react-stampit with material-ui
To set material-ui I need to set getChildContext() and childContextTypes.

for some reason when trying to so I get an error:

uncaught Error: Invariant Violation: ReactStamp.getChildContext(): childContextTypes must be defined in order to use getChildContext().

here is the code i'm running

import stampit from 'react-stampit';
import { Styles, RaisedButton } from 'material-ui';

const ThemeManager = new Styles.ThemeManager();


export default React => stampit(React, {
  childContextTypes: {
    muiTheme: React.PropTypes.object,
  },
  getChildContext() {
    return {
      muiTheme: ThemeManager.getCurrentTheme()
    };
  },
  render() {
    return <div>
        <h1>Hello World</h1>
        <RaisedButton label="Click Me" />
      </div>
  }
});

Any idea what i'm doing wrong?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions