Does React Router index pages to Google?

Viewed 38

I want to create a personal blog with React and my question which I was unable to find is whether the library React Router would give access to Google to index my blog articles.

I was planning on using Meteor with React and having a reusable component child who will get specific parameters when an onClick event occurs and with that parameter make a query to the database and get the article data to display it.

By doing this will Google index all my articles? Or should I do it another way?

3 Answers

Anwser to this question is not straightforward, but in short - no.

I would suggest server side rendering, since google bot still does not handle spa as good as static HTML.

Check out next.js or remix.run.

If you want to start personal blog, maybe the best approach will be to use framework that based on React and has an option of Static Generation.

Check one of these:

Both has pretty good documentation and community.

Router does...routing. For your case you will need:

  • React Router for routing.
  • React Helmet (https://www.npmjs.com/package/react-helmet) to inject your HTML headers for your blog pages (title, description, image of different image sizes for social media).
  • You will also need a sitemap.xml in your public folder.
  • Meteor SSR or Prerendering. Prerender.io has a 0$ service for small blogs of up to 250 pages: https://prerender.io/pricing/ Meteor + React is a great way to keep a blog. With a front end library like MUI or Bootstrap or pretty much anything else, you can score 100% on Google Page insights. If you prefer Bootstrap, note there is a Reactstrap library. If your previews are not being generated instantly in Whatsapp share or social media, I keep a version of Helmet that injects the headers at the very top instead of ... very bottom. If you run into any challenges, just find us on the Meteor forum as well.
Related