HNHacker News
TopNewBestAskShowJobs

gracehaz

24 karma · joined April 9, 2018

submissionscomments
gracehaz··on Show HN: Generate React components by replicating your own
This can be easily done by creating a npm script "generact path/to/boilerplate/component.js" and just running `npm run generact`.

The difference though is that you'll still be prompted for component path and name, but I'd gladly accept a PR adding options to CLI (maybe --path, --name?) to skip that part.

gracehaz··on Show HN: Generate React components by replicating your own
I'd done that too. But I found some problems with that approach:

- you can't automatically create files (AFAIK);

- it doesn't help your team mates, only works for you and with that specific editor;

- if you start working on a different project with different standard, you'll need to update the snippets or create new ones.

Turned out that I was always copying and pasting, so I decided to create this tool.

gracehaz··on Show HN: Generate React components by replicating your own
Kinda, but not really. XD

It copies files, renames them and replaces their names in the contents.

gracehaz··on Show HN: 2kB React state management library using the new Context API
Components relying on <State context> will be re-rendered with new state.