Skip to content

Instantly share code, notes, and snippets.

@burtyish
Last active August 29, 2016 12:16
Show Gist options
  • Save burtyish/38c8399dfda1585f1558 to your computer and use it in GitHub Desktop.
Save burtyish/38c8399dfda1585f1558 to your computer and use it in GitHub Desktop.
WebStorm template for new ES6 React component file. Converts hyphen-separated filenames to PascalCase class name.
#set( $lowerCaseName = "$NAME" )
#set( $newName = "" )
#foreach( $part in $NAME.split("-") )
#set( $newName = "$newName$part.substring(0,1).toUpperCase()$part.substring(1)")
#end
import React from 'react';
const $newName = React.createClass({
propTypes: {
},
render() {
return <div></div>
}
});
export default $newName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment