Skip to content

Instantly share code, notes, and snippets.

@mweibel
Last active August 29, 2015 14:12
Show Gist options
  • Save mweibel/521e39e89087bfe410d8 to your computer and use it in GitHub Desktop.
Save mweibel/521e39e89087bfe410d8 to your computer and use it in GitHub Desktop.
WebStorm/IntelliJ React component file template
/** @jsx React.DOM */
'use strict';
var React = require('react');
## Will replace dashes in names with camelCase
#set($componentName = "")
#foreach($str in $NAME.split("-"))
#set($str = $str.substring(0,1).toUpperCase()+$str.substring(1))
#set($componentName = $componentName + $str)
#end
var ${componentName} = React.createClass({
propTypes: {
},
render: function() {
return null;
}
});
module.exports = ${componentName};
@mweibel
Copy link
Author

mweibel commented Dec 30, 2014

How to use?

In your project, right click on e.g. a folder and select New -> Edit File Templates and add a new template containing the code above.

@mekanics
Copy link

Thx!
definitely better than mine ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment