The SEO Problem and the NextJS Framework
When we develop a website, it is important for us to understand whether we will promote this website in search engines. By search engines, we mean specialized sites like Google or Yandex, where the user searches for the information they need.
If our site is shown in the top positions for a specific query, it will provide it with a continuous stream of visitors. And we won't have to pay anything for these visitors, unlike visitors who come from advertising.
And here we face a problem: websites developed with React will not be promoted in search engines. The fact is that the content of such a site's pages is generated dynamically in the browser via JavaScript. Search engines do not yet know how to process such pages. Accordingly, such a site will not be able to fully appear in search results.
For search engines to be able to fully work with our site, the text of its pages must be created on the server side and sent to the browser as ready-made HTML code.
This is the problem that the NextJS framework solves. It allows writing JSX code on the server side. The server converts this JSX into normal HTML and delivers it to the browser. Thus, the HTML code needed for the correct operation of search engines with our site will be sent to the client side.
How exactly this is done is what we will study in this tutorial.
It should be said that search engines are already learning to recognize JavaScript-generated content. When they fully learn how to do this, the entire website development landscape will change radically. And frameworks like NextJS will either not be needed at all, or will become completely different in their principles.
So, let's get started:)