Skip to content
Advertisement

How to dynamically add meta tags for seo and social share in react js app

I am currently working on a news website using react js (backend expres.js rest API). This site needs social share functionality with the image and title of the post. I add meta tags using a helmet. I tried to pre-render packages too, Even though this does not show images of the post when sharing. Can I achieve this using API without server-side rendering? please help me to do this.

Advertisement

Answer

I did this using next.js (the react framework). This can make API call and generate HTML in the server. With this, SEO and sharing with title and image are working properly.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement