All Projects → hemanth → react-mui-base

hemanth / react-mui-base

Licence: MIT license
BaseComponent for react-material-ui

Programming Languages

javascript
184084 projects - #8 most used programming language

react-mui-base

BaseComponent for react-material-ui

Install

$ npm install --save react-mui-base

Usage

Instead of :

'use strict';
import {Component} from 'react';
import {Styles} from 'material-ui';
import injectTapEventPlugin from 'react-tap-event-plugin';

injectTapEventPlugin();

let ThemeManager = new Styles.ThemeManager();

class MyComponent extends Component {
  constructor() {
    super();
  }
  getChildContext() {
    return {
      muiTheme: ThemeManager.getCurrentTheme()
    };
  }
	render() {

	}
}

MyComponent.childContextTypes = {
  muiTheme: React.PropTypes.object
};

MyComponent.contextTypes = {};

We could do:

import BaseComponent from 'react-mui-base'

class MyComponent extends BaseComponent {
	constructor() {
		super();
	}
	render() {

	}
}

License

MIT © Hemanth.HM

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].