The 3 essential rules of really-reusable #javascript #components
▻https://hackernoon.com/the-3-essential-rules-of-really-reusable-javascript-components-123a54d09
How can I reuse this supposedly reusable component in the page I’m building?So you’re using a components-based framework such as #react JS, Vue JS, or the latest Angular? React popularized the idea of components a few years ago as a way to reuse code and build web apps more efficiently.“That’s great in theory, but in my experience these fancy “reusable” things are never reused”, said my skeptical 43 year-old coworker, as I introduced the team to VueJS.As the project went on, it turned out he was mostly right. The emergence of this new paradigm of component-based interfaces has left many questions unanswered:How do you define the scope of a component? How do you decide what should be included in one component, and what should be left to a separate component ?Where do you put the styles?At what (...)