Search⌘ K

A Brief Introduction to React

Explore the fundamentals of React, a JavaScript library for building reusable UI components with a virtual DOM. Understand how React supports universal JavaScript by enabling rendering on both client and server sides, improving SEO and user experience. Learn to create your first React component and see how server prerendering combined with client-side hydration leads to efficient single-page applications.

We'll cover the following...

React is a popular JavaScript library created and maintained by Facebook. React is focused on providing a comprehensive set of functions and tools to build the view layer in web applications. React offers a view abstraction focused on the concept of a component. A component can be a button, a form input, a simple container such as an HTML div, or any other element in our user interface. The idea is that we should be able to construct the user interface of our application by just defining and composing highly reusable components with specific responsibilities.

What makes React different from other view libraries for the web is that it’s not bound to the DOMDocument Object Mode by design. In fact, it provides a high-level abstraction called the virtual DOM that fits very well with the web but can also be used in other contexts, for example, for building mobile apps, modeling 3D environments, or even defining the interaction between hardware components. In simple terms, the virtual DOM can be seen as an efficient way to rerender data organized in a tree-like structure.

“Learn it once, use it everywhere.” This is the motto used by Facebook to introduce React. It draws a comparison to the famous Java motto “Write it once, run it everywhere” with the clear intention to underline a fundamental shift from the Java philosophy. The original design goal of Java was to allow ...