Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SEO-friendly React-Redux app

Tags:

reactjs

seo

redux

React apps render components on the fly, dynamically, so it makes it impossible for search engines to index pages, and complicates social sharing. What is the best practice to handle such issues, and make a React-Redux app SEO-friendly?

like image 524
ASh Avatar asked Dec 13 '16 06:12

ASh


People also ask

Are React apps SEO friendly?

Is React good for SEO? React is a JavaScript framework developed to build interactive and modular UIs. SEO is not a design goal of React but content websites built with React can be optimized to achieve better indexing and ranking.

Is React Helmet enough for SEO?

React Helmet is a library that helps you deal with search engines and social media crawlers by adding meta tags to your pages/components on React so your site gives more valuable information to the crawlers. “This reusable React component will manage all of your changes to the document head.

Why is NextJS better for SEO?

Load speed is one of the most important factors when it comes to SEO and Google ranking, and with Next. js, you're simply faster. What makes Next. js stand out against other popular frameworks, is that it renders the HTML on the server (server-side), rather than in the browser (client-side).


1 Answers

We Need Server-Side Rendering to do SEO for a React App!

Let’s split up the application’s architecture into three parts: an API server that provides data, a web server that will share code with the client-side and also render HTML, and finally the client i.e. the code that gets run in the browser.

Basically, Server-Side Rendering will allow part of your code to be ran on your web server first. This means the server will first obtain the data from your API that is needed to render on the initial page’s HTML, and then it will package and send this data to the client as HTML.

After the client gets the initial page HTML and the required data, it will continue the whole JavaScript rendering business, but it already has all the required data. So, using the small example above, a client-side rendering SPA would have to start from scratch, but a server-side rendering SPA would be at a starting point where they already have all the data. Thus, this solves the SEO and slow initial loading problems that SPAs share).

This seems like a rather intuitive idea, but it was only taken more seriously when React came out, since React allows you to do server-side rendering in an elegant manner.

To sum up, server-side rendering can be broken down into 3 steps:

(1) Obtain the data needed to render the initial loading page.

(2) Render the HTML using this data.

(3) Package the HTML and send it to the client side.

For more follow this link:

https://www.codementor.io/reactjs/tutorial/redux-server-rendering-react-router-universal-web-app

like image 83
Rohit Sharma Avatar answered Oct 16 '22 14:10

Rohit Sharma