Skip to content

Instantly share code, notes, and snippets.

@TilBlechschmidt
Last active May 25, 2018 07:39
Show Gist options
  • Save TilBlechschmidt/ff14847609d2710f3173e248341de34b to your computer and use it in GitHub Desktop.
Save TilBlechschmidt/ff14847609d2710f3173e248341de34b to your computer and use it in GitHub Desktop.
React file templates for dev w/ material-ui-next
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core';
const styles = theme => ({
});
class SomeComponent extends Component {
static propTypes = {
classes: PropTypes.object.isRequired
};
render() {
const { classes } = this.props;
return (
<div>
Hi there!
</div>
);
}
}
export default withStyles(styles)(SomeComponent);
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core';
import {translate} from "react-i18next";
import { withTracker } from 'meteor/react-meteor-data';
import { Characters } from '../../../../../api/character';
const styles = theme => ({
});
class SomeComponent extends Component {
static propTypes = {
classes: PropTypes.object.isRequired
};
render() {
const { classes } = this.props;
return (
<div>
Hi there!
</div>
);
}
}
export default withTracker(props => {
Meteor.subscribe('characters');
return {
character: Characters.findOne({ _id: props.characterID })
};
})(
translate('someNamespace')(withStyles(styles)(SomeComponent))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment