SEO For ReactJS Websites
Some of the areas to watch for retaining and growing organic traffic when moving to a React JS site are listed below.
URLs should look like static URLs with directories as much as possible (http://www.alicesbooks.com/fiction/sci-fi/). Even better, make sure you use words that describe the content so that anyone can understand it.
Users should be able to view and share a URL specific to their current page. This will help search engines and users. Nobody likes sending a link to someone, only to discover that the link doesn’t lead to the right page!
Developer Note: One method to develop these types of unique URLs is a navigational component for React, such as React Router https://github.com/ReactTraining/react-router. PMG utilizes React Router with some our own tools.
Ensure consequential content is linked by links to ensure search engine discovery.
Developer Notes on Implementation
Server-side rendering of the HTML can be done by using “ReactDOM.renderToString” instead of “ReactDOM.render.” React Helmet can be useful to render head section elements such as meta tags.
Take a look at the [Next JS framework](https://github.com/zeit/next.js/) for React. Next JS is built specifically for server-side rendering and comes with its own internal routing library. Building from the ground up is easier than retrofitting code to do the server-side rendering.
Sign up for weekly articles & resources.
Interested in working with us? [See our open engineering roles here.](https://www.pmg.com/careers/engineering/?utm_source=website&utm_medium=blogpost&utm_campaign=EngineeringCareers&utm_content=CTA)
Posted by John Greer