2 ms·
It's transitioning from "document-based" reasoning to "component-based" reasoning. Preferably, all local concerns of a component (not referring to the React co
by lilactown 10y ago
It's transitioning from "document-based" reasoning to "component-based" reasoning.
Preferably, all local concerns of a component (not referring to the React component class but the abstract component: a single unit within a larger project) would be in one place. For the front end of a web app this includes structure, styling and behavior. So it makes sense to define the structure (HTML), styling (CSS) and basic behavior (animations, different states it can exist in, etc.) in one place.
React models this using JSX, inline CSS (or CSS loaders) and the React component API.