Forms of Composition in JavaScript and Reactby@sambernheim
923 reads
923 reads

Forms of Composition in JavaScript and React

by Sam Bernheim11mSeptember 6th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - Forms of Composition in JavaScript and React
Sam Bernheim HackerNoon profile picture
Sam Bernheim

Sam Bernheim

@sambernheim

Software Engineer @ Twitter

Learn More
LEARN MORE ABOUT @SAMBERNHEIM'S
EXPERTISE AND PLACE ON THE INTERNET.

Share Your Thoughts

About Author

Sam Bernheim HackerNoon profile picture
Sam Bernheim@sambernheim
Software Engineer @ Twitter

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
L O A D I N G
. . . comments & more!