sk904861 sk904861 - 9 months ago 51
React JSX Question

How do you use React.js for SEO?

Articles on React.js like to point out, that React.js is great for SEO purposes. Unfortunately, I've never read, how you actually do it.
Do you simply implement

as in and let React render the page on the server, when the url contains
, or is there more to it?

Being able not to rely on
would be great, as probably not all potentially crawling sites (e.g. in sharing functionalities) implement

Answer Source

I'm pretty sure anything you've seen promoting React as being good for SEO has to do with being able to render the requested page on the server, before sending it to the client. So it will be indexed just like any other static page, as far as search engines are concerned.

Server rendering made possible via ReactDOMServer.renderToString. The visitor will receive the already rendered page of markup, which the React application will detect once it has downloaded and run. Instead of replacing the content when React.renderComponent is called, it will just add the event bindings. For the rest of the visit, the React application will take over and further pages will be rendered on the client.

If you are interested in learning more about this, I suggest searching for "Isomorphic JavaScript" or "Isomorphic React", as this is becoming the term for JavaScript applications that use a single code base to render on both the server and client.