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.
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
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:
and that's all!