Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React.js, view source is empty, is it bad for SEO?

I am trying to create a website using React.js (using React Router, not u Next.js). liveitcourses.com is the name of the website which is still in progress.

But I am facing a strange issue. On every page of the website whenever I am trying to see the "view source", the tag body is showing empty. I am afraid if it is not showing the body contents in the view source, search engines will not be able to crawl my pages, hence bad impact on SEO.

I just started React a few weeks ago. Is it the normal React behaviour or should I need to correct it? If my understanding is correct then how can I make my website crawlable for search engines. Please suggest.

Here is the HTML, body tag is empty while title and other meta tags are present:

<html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Learn IT courses online in interactive and live classes."/><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"/><title>Best online IT courses based on live classes and interactive programming sessions</title><script defer="defer" src="/static/js/main.80f62ed5.js"></script><link href="/static/css/main.53eb7892.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
like image 695
khush Avatar asked Nov 15 '25 09:11

khush


1 Answers

That's how React is, a library for making SPA (Single Page Application), where everything is handled via JavaScript in the browser. For an application made entirely with React, indeed, the server send this empty HTML template with scripts to be executed. You can use the inspection tool to see your content after they are executed.

And yeah it's bad for SEO as Search Engine Crowlers are on hurry (there is a limited time for a page). If that's something that matter for your application, you should try Next.js, Gatsby... or use Server Side Rendering as known for decades with PHP, Node.js...

like image 160
yousoumar Avatar answered Nov 18 '25 04:11

yousoumar