When sharing Reactjs links on social media, meta tags in react-helmet not displaying

Viewed 1322

I have a project running reactjs on the client side, and nodejs/express on the backend. I implemented react-helmet to update the title and meta tags for routes beyond the index. For example, the user views a post at /viewpost?q=POSTID, then client makes a GET request to the backend to fetch the data for that post which is what populates the meta tags. The title tag is updating properly in the browser, but when I try to share that post on social media the description and title are still displaying the meta data from index.html

I've looked into react-snap, prerender, and react-static to try and server-side render the specific pages, but because I already have a backend, I'm not quite sure how to implement those. I'm wondering if anyone can offer advice on how to accomplish what I'm trying to do.

Thanks!!

0 Answers
Related