The Beauty of React — Simply

Vincent Collis
2 min readFeb 6, 2021

React JS is a JavaScript Framework for a developer to build interactive elements on websites. It makes it painlessly easy to create interactive UIs. This is done by designing simple views for each state of an application. React efficiently, then update and render just the right components based on changes in your data.

For example:

The code on the left is a snippet of a simple weather application I have been building. This App uses OpenWeatherMapAPI to display the current weather of a zip code the user enters.

When submitting the form with a zip code, the App queries the API data and returns four pieces of information to our component.

This is the beauty of React. It only updates the elements that need to be changed instead of re-rendering your whole application! Let’s take a look at what happens when I enter a different zip code.

Conditions stay the same because the data fetched and passed to that component did not change, while everything did. We even see conditional rendering occur in Feels Like because the temperature returned triggers logic stored in our props!

--

--