3 ms·
I've started doing this as well, and I'm finding often my solutions end up being simpler, better and have less dependencies than the go-to solution anyway. For
by BigJono 9y ago
I've started doing this as well, and I'm finding often my solutions end up being simpler, better and have less dependencies than the go-to solution anyway.
For example, here's a React 'collapse' component, as people commonly use for accordions.
https://gist.github.com/JonathonAshworth/b401810b965149348d03e2465a971201 https://gist.github.com/JonathonAshworth/b401810b965149348d0...
It has 1/10th the code of rc-collapse (the 'go-to' solution it seems), and 4 less dependencies. And it's simple enough that basically any competent Javascript programmer can edit the code if they want slightly different functionality.
Importing NPM modules for this stuff is madness