A template for neat & clean React components.
Type React.cc→ followed by a tab to generate this beauty:
React.createClass({
////////////////////
// PROPS & STATES //
////////////////////
propTypes : {
},
getDefaultProps() {
return {
}
},
getInitialState() {
return {
}
},
////////////////
// RENDERINGS //
////////////////
render() {
return (
<div>
</div>
)
},
/////////////////////
// LIFECYCLE HOOKS //
/////////////////////
////////////////////
// EVENT HANDLERS //
////////////////////
/////////////
// GETTERS //
/////////////
/////////////
// SETTERS //
/////////////
//////////////////////
// DOM MANIPULATORS //
//////////////////////
////////////////////
// HELPER METHODS //
////////////////////
})- Open Package Control inside of Sublime Text using
shift + cmd + P
- Search for: Package Control: Add Repository
- Add the link to this repo: https://github.com/krishnr/react-component-snippet
- Now install the snippet:
shift + cmd + PTo launch Package Control again. - Start typing: Package Control: Install Package
- Search for
react-component-snippet - Done! Test it out by typing
React.cc→