head (app/head) doesnt work properly when sharing the page #15112
-
I've migrated from create-react-app to create-next-app to my website for the SEO, but the Head(app/head) component isn't working properly Assuming I have a blog, and in pages, I have the following structure: pages/blog/index.js, pages/blog/[slug].js. In [slug].js, I'm using the Head component so it takes the title of the blog post: <title>{post.title}</title> The problem is that when using react-share on the blog post it doesn't put the right title, even when I do an inspect element on the page, I can see the right Head values, but the Facebook debug (https://developers.facebook.com/tools/debug/) tool doesn't recognize the right title. am i doing something wrong ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You need to make sure that SSR is going right: check for rendered HTML source(not via element inspector), check if you have fetched data initial props via |
Beta Was this translation helpful? Give feedback.
You need to make sure that SSR is going right: check for rendered HTML source(not via element inspector), check if you have fetched data initial props via
getIntialProps
,getServerSideProps
, orgetStaticProps
correctly and the component is actually using those props.