Skip to content

Instantly share code, notes, and snippets.

@jamielob
Created July 13, 2016 19:46
Show Gist options
  • Save jamielob/9fd76b30d7e477ade708524388079413 to your computer and use it in GitHub Desktop.
Save jamielob/9fd76b30d7e477ade708524388079413 to your computer and use it in GitHub Desktop.
A sample of the ES6 React snippets that I use in Atom
'.source.js':
'Component - Function (React+Meteor)':
'prefix': 'component'
'body': '''
import React from 'react';
const $1 = () => (
<div>
$2
</div>
);
export default $1;
'''
'Component - Class (React+Meteor)':
'prefix': 'componentClass'
'body': '''
import React from 'react';
class $1 extends React.Component {
render() {
return (
<div>
$2
</div>
);
}
}
export default $1;
'''
'Validated Method (Meteor)':
'prefix': 'validatedMethod'
'body': '''
export const $1 = new ValidatedMethod({
name: '$2.$1',
validate: null,
run() {
$3
},
});
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment