Over the past few years, the popularity of static sites has grown significantly. This growth is primarily due to a strong desire among companies in optimizing the performance of their products. Another reason for using static sites is cost-effectiveness, static files are lightweight and often faster. In this article, I will introduce a static site generator for React library which is React static.

React Static

Static generators vs. dynamic sites

Static sites are written only in HTML. Static websites use server-side rendering, which means that a user accessing the site receives a finished HTML file. All expensive operations with dynamic sites are performed by the client, while with static sites it is the server that performs the most costly operations.


How React Static works

React Static collects data and templates together, and intelligently splits them into static files of small size using webpack and javascript. Once these files are generated, React Static uses them to render and export the routing list. Also, React Static provides a zero-configuration environment for developers just like Create React App, so it is quick and easy to use.


Installing React Static

Installation is trivial, we only need a package manager, in this case I will use NPM. Open your terminal and type the following command:

npm install -g react-static


Then, to create a new project we use the command:

react-static create

and that's all!

Related articles

Show all articles