Composition: Every Layout
every-layout.dev·2d
🧱WASM Components
Preview
Report Post

If you are a programmer, you may have heard of the composition over inheritance principle. The idea is that combining simple independent parts (objects; classes; functions) gives you more flexibility, and leads to more efficiency, than connecting everything—through inheritance—to a shared origin.

Composition over inheritance does not have to apply to “business logic”. It is also beneficial to favor composition in front-end architecture and visual design (the React documentation even has a dedicated page about it).

Composition and layout

To understand how composition benefits a layout system, let’s consider an example component. Let’s say that this com…

Similar Posts

Loading similar posts...