Last active
August 29, 2015 14:12
-
-
Save mweibel/521e39e89087bfe410d8 to your computer and use it in GitHub Desktop.
WebStorm/IntelliJ React component file template
This file contains hidden or 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
/** @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}; |
Thx!
definitely better than mine ;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.