tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.35k stars 1.28k forks source link

Make it possible to create React icons #225

Closed paperfella-ceo closed 3 years ago

paperfella-ceo commented 3 years ago

The build-react.js script doesn't work. It has two errors.

  1. The buffer doesn't precisely get the raw text when using fs.readFile(*.svg, 'utf8').
  2. The paths are all wrong.

I fixed the first problem by changing the extension to .txt and re-changing it back to .'svg' after creating the React icons.

I also added a delete-react-icons script that makes it possible to delete all the React icons we may create.

I've added some dependencies:

I've also added a .prettierrc to configure the svgr's default format and changed the README.md in order to give more information about these new scripts.

Now everything works correctly.

I'll like to add some new features. I'll like to add native Typescript format in svgr. But for now, the code just can create .tsx or .js React components.

adamwathan commented 3 years ago

Hey thanks for this! Unfortunately it looks like this is pretty out of date now and not relevant since we publish React components under @heroicons/react, so going to close. I appreciate it though ❤️