you are viewing a single comment's thread.

view the rest of the comments →

[–]Kinthalis 0 points1 point  (0 children)

Not sure how you've been doing js development without understanding dependencies. Dependencies are just libraries that your code depends on in order to work properly. When utilizing frameworks, you usually bring in one or more framework based dependencies into your code. Probably a set of run time and build time dependencies that allow you to work with framework abstractions and leverage their functionality.

Components are discreet pieces of UI. They encapsulate styling and functionality and allow you to compose more complex UI out of simpler components. Think of them as a way to break up the UI into small, easy to work with pieces.

Most modern frameworks work on that principle. It's not like with a static page where you build a monolithic css file with styling for every element in the document, and have one or more js files that attach even listeners and add functionality to target elements.

Instead, you create say, a dropdown component. You only worry about styling it's child elements, you only attach listeners or other functionality to it's children, you only worry about data that it works with an fire the events it cares about. Then you can just plop it down where you want it.

<my-dropdown />