Skip to content

Instantly share code, notes, and snippets.

@eldh
Created November 8, 2014 15:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eldh/c23f0584e571eb23fbc1 to your computer and use it in GitHub Desktop.
Save eldh/c23f0584e571eb23fbc1 to your computer and use it in GitHub Desktop.
React Icon component
React = require 'react/addons'
module.exports = React.createClass
displayName: 'Icon'
propTypes:
className: React.PropTypes.string
icon: React.PropTypes.string.isRequired
render: ->
React.createElement 'span',
dangerouslySetInnerHTML:
__html: require "./#{@props.icon}.svg"
className: "icon #{@props.className or ''}"
{ test: /\.svg$/, loader: 'raw-loader' },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment