ReactJS – philosophy

Spread the love
Reading Time: 2 minutes

Let’s review why ReactJS became rather popular!

Its philosophy can be summed as:

  • write components
  • concentrate on one task at hand
  • your button is a button is a button
  • tight isolation of the internals of a component
  • say goodbye to most variable hoisting bugs in your code!
  • use raw JavaScript, JSX or TypeScript
  • if you can’t see your whole component without scrolling in your editor, refactor your code!

The real benefits of component thinking?

Photo by Will Echols on Unsplash

Think of that delicious piece of cake. Doesn’t it look clean, very enticing? There are layers; and the cake has a definite shape. However, the process of making one piece of cake is nothing but clean.

[Sorry guys – I have no idea why I brought that cake here. I’m trying a sugarless diet mostly]

In React, each component has a shield against global scope.

Each component also protects the scope at the same time. It’s a two way street, except… well, two-way was bad analogue. Since in React, the whole idea started with ‘props’: passing each component the necessary information, strictly one way. The component doesn’t see the global scope, and it shouldn’t.

Your React components are the hot-blooded trotters with eye patches properly aligned to make your web app a winner!

React-world: we prefer one-way streets!
Photo by Brendan Church on Unsplash

Facebook Comments

Published by jukkasoft

Hi! A bit updated description. Code enthusiasta, technology optimist, but also a realist. In my blog I wrote 80% of technology related articles, mostly in English and Finnish. I like to envision and ponder about things, how life could be, what we are doing wrong today, and so on. "Invented" a facebook -like system in 2000, as a short product pamphlet. Haven't yet realized the 20+ ideas that might have become big things. Maybe learning this skill one of these days!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: