React 17 was released on 20th October, 2020. It doesn’t contain any developer facing new features. But there are lots of internal things that have changed in React. Below are the highlight of the main changes:

  1. Gradually Upgrade.
  2. Changes to Event Delegation
  3. New JSX
  4. Other Changes

Gradually Upgrade

React 17 allows embedding the tree that is managed by one version of React inside the tree that is managed by another version of React.

Embedding tree managed by React 17 in React 18.

This means that when React 18 and the next future versions come out, we’ll have the option to gradually upgrade…

If you landed here then you have an idea that React uses Virtual DOM for better performance and want to have better understanding of it. In this article we will try to find out what is DOM and its problem, what is Virtual DOM, how it solves DOM’s problems and how React uses Virtual DOM.

What is DOM?

“The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document.”

The DOM is an abstraction of a page’s HTML structure. It takes HTML elements and…

It’s good to have basic knowledge of Event Loop, Component lifecycle methods and Virtual DOM for better understanding of this article.

For an end user the expected behavior is the site load with proper data in first go. But in case of API call it takes some time to fetch the data from server. In this scenario next expected behavior is a loader should appear till the data received. When data received, loader should disappear and page should appear with proper data.

Now in react Component mount lifecycle methods are:

  • constructor()
  • componentWillMount()/UNSAFE_componentWillMount() // obsolete
  • getDerivedStateFromProps()
  • render()
  • componentDidMount()

Here we’ll consider…

Devinder Suthwal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store