News for hackers. Stuff that matters.
Re:Ask HN: Do you reuse components from your previous projects? by mlejva on Tuesday August 27, 2019 @06:43AM (#20808107)
I code in React and what I usually do is that I copy & paste core code for some basic components like html `input` tag.

I would make use of a tool where I could "store" such components.

Re:Ask HN: Do you reuse components from your previous projects? by duxup on Tuesday August 27, 2019 @09:32AM (#20809374)
There are a number of options that allow you to store React (or any really) type boilerplate in a git gist and then access it via VSCode if that is what you're thinking of. Often via a VSCode extension.
Re:Ask HN: Do you reuse components from your previous projects? by sabarasaba on Tuesday August 27, 2019 @06:45AM (#20808123)
really? its as easy as putting it on github and publishing it in npm.
Re:Ask HN: Do you reuse components from your previous projects? by mlejva on Tuesday August 27, 2019 @06:49AM (#20808147)
It just feels as such a hassle and overkill to maintain another repo/package just for a few components.

Another problem is that usually, I realize I want to change the basic component while I'm using it in a different project. So now I have to open another workspace, update it, and publish. Then `npm update` in the project where I'm using my component... I just feel it should be much easier.

Re:Ask HN: Do you reuse components from your previous projects? by quickthrower2 on Thursday August 29, 2019 @07:54AM (#20828651)
Git submodules might be worth considering. It’s like having the dependency copy pasted into your project so you can modify it. Different projects can pin to different versions of the submodule.