Too Long; Didn't Read
In functional programming, the basic unit for composition is functions and larger functions are built by connecting and combining smaller ones. Composition relies on recursion to build larger abstractions from smaller abstractions but with each abstraction layer as the same type as all the others. ReactJS uses components as a unit of composition in JavaScript and ReactJS. The idea is similar to legos, legos that can be joined and yield another lego that can continue to be built on and attached to others. It uses an imperative style, while it isn't necessarily clean code, it is simple enough to get the desired result.