Last active
May 25, 2018 07:39
-
-
Save TilBlechschmidt/ff14847609d2710f3173e248341de34b to your computer and use it in GitHub Desktop.
React file templates for dev w/ material-ui-next
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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