1

i have a react app, it is deployed, available and registred at google long ago. Google sees sitemap, pages that are on sitemap are indexed, but all what google sees - is like - so only page before loading. The same in url inspection tool - look the same blank. I am not using create-react-app but proper webpack build

...
  <body>
    <div id="root"></div>
  </body>

So what am i missing? Should't nowadays google crawler be able index react app?

UPD: I understand that other frameworks, with another rendering aproach may work. But does that mean that after all the years - google can't index second most popular framework? So at the end of the day react totally unusable by itself?

UPD2: react produces the html page with main.js script - that is executed on page and shows all content. Not only react does this. There are other frameworks doing the same. So it means google tottaly helpless in this situation?

4
  • Yes, React still makes SEO difficult. Commented Feb 26, 2024 at 15:25
  • I recommend googling "react seo" or something similar. This is a well known problem and lots of information already exists on the Internet about it, including possible solutions. Commented Feb 26, 2024 at 15:44
  • For example, this reddit post seems very helpful: reddit.com/r/reactjs/comments/y0sy7h/comment/iru09hf/… Commented Feb 26, 2024 at 15:46
  • 1
    @Code-Apprentice i have all diferent pages, they are mentioned in sitemap. About buttons and links - google doesn't come to the stage where buttons-links-anytext is loaded. Even on simple text-only pages, explicitly registered in google - not indexed correctly (indexed, but ad i shown abow - only div="root") Commented Feb 26, 2024 at 15:49

2 Answers 2

1

I think this is due to React being SPA so Google is only cataloguing the first page. I believe NextJS solves this problem.

1
  • it doesn't index any single page of my app. I understand that other frameworks, with another rendering aproach may work. But does that mean that after all the years - google can't index second most popular framework? So at the end of the day react totally unusable by itself? What about advertized headless chrome used by google crawler. Commented Feb 26, 2024 at 15:21
1

No. Google is not able to index the contents of a client side react application. This is because the Google Crawler does not wait for asynchronous requests to resolve, and because your pages are rendered on the users' client, they will appear to be empty pages:

<!-- This is googles perspective -->
<body>
  <div id="root"></div>
</body>

Modify your app to render on the server with something like Next.js. This will pre-render what is possible on the server while still being able to dip into client-side code.

4
  • you are saying - react absolute unusable crap, just re-write application with another framework. Easy soultion ))) Google claims it can handle react for many years - as uses headless chrome for crawling, so for example ya.ru search engine works with indexing of my site fine. Commented Feb 26, 2024 at 15:23
  • React is not a framework, it is a library. Next.js is a framework that is built on React. The usage of create-react-app is discouraged if you need seo friendly content. Commented Feb 26, 2024 at 15:30
  • react doesn't mean create-react-app, i use webpack Commented Feb 26, 2024 at 15:33
  • 1
    @user453575457 Does not make a difference, it is still 100% client rendered react. No static HTML = not indexable by Google. This does not make React "unusable crap", you simply need to choose the right solution for your requirements. Commented Feb 26, 2024 at 15:46

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.