feathericons / react-feather

React component for Feather icons
https://npm.im/react-feather
MIT License
1.92k stars 126 forks source link

When using non-ES6 imports, need to specify the exported default #5

Closed kurttheviking closed 6 years ago

kurttheviking commented 6 years ago

From what I can tell, the README suggests the following approach to import the Camera component in the absence of ES6 imports:

var Camera = require('react-feather/dist/icons/camera');

However, the published dist/.../camera.js file exports like this:

exports.default = Camera;

Thus, it seems like the README should read:

If you can't use ES6 imports, it's possible to include icons from the compiled folder ./dist.

var Camera = require('react-feather/dist/icons/camera').default;

var MyComponent = React.createClass({
  render: function () {
    return (
      <Camera />
    );
  }
});

Or, perhaps, I am just missing something...

carmelopullara commented 6 years ago

Yes, you are completely right. I'm going to update the README.

Thanks!