Skip to content

Instantly share code, notes, and snippets.

@rapind
Created August 16, 2015 23:46
Show Gist options
  • Save rapind/232fe64c9650587977af to your computer and use it in GitHub Desktop.
Save rapind/232fe64c9650587977af to your computer and use it in GitHub Desktop.
App = Component.create
displayName: 'App'
module.exports =
create: (comp) ->
React.createFactory React.createClass(comp)
config.plugins = [
new webpack.ProvidePlugin({
'React': 'react',
'Component': __dirname + '/scripts/lib/component'
})
];
@rapind
Copy link
Author

rapind commented Aug 16, 2015

You could just expose the function, but I think Component.create has a nice ring to it. Maybe ReactComponent.create or something if you want to be more specific, or namespace it to the project like; ProjectComponent.create

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