Want to make dynamic pages indexable using react cra

Viewed 1149

So i have this social media app with multiple pages, it's all created with create react app with context api and react-router for routing and laravel for backend. Now, google won't be able to index these dynamic pages, i have tried pre rendring the pages using react-snapshot, currently looking into next js. i know react has this react dom server, will it be good idea to hook up another server just for pre-rendring the page before sending it to the client.

Is there any other way to do ssr with cra.

2 Answers

First things first, Google is able to index client-side rendered pages. I think next.js is a good choice for SSR, but you can also look at razzle - maybe you can retrofit that to your CRA setup.

Google should index your website. please check your robots.txt file and also try to provide sitemap.xml for better crawling for google.

Also, there are some issues with using react-snap and that is you render the page at build time and your site render won't change if you read your content from the database and update your database while you didn't rebuild your app. you can use after.js but next.js have a bigger community and more tutorials out there so I recommend you use next.js.

Also, there is a tool named prerender.io(open source) and you can serve rendered page to search engine bots this is the easiest way in my opinion and do not have the downside of using react-snap

Related