facebook - How to include meta tags dynamically in react js? -


i using reactjs , want share content in facebook,it happening after sharing not showing images,title,description of content. used react-helmet dynamically add meta tags in index.html.

<helmet> <meta property="og:type" content="video.other" /> <meta property="og:image"       content="https://www.w3schools.com/css/trolltunga.jpg" /> <meta property="og:title" content="my title" /> <meta property="og:url" content="https://www.afnity.com/video/155" /> <meta property="og:description" content="some discription of shared    content" />  </helmet> 

and here share button

   <button> <a title="dummy"  href="http://www.facebook.com/sharer.php? u=https://dummy.com/videos/id=25"     target="_blank"> share</a> </button> 

but not working.

replace helmet component below code.

<helmet   meta={[     {"property": "og:type", "content": "video.other"}     {"property": "og:image", "content": "https://www.w3schools.com/css/trolltunga.jpg"}     {"property": "og:title", "content": "my title"}     {"property": "og:url", "content": "https://www.afnity.com/video/155"}     {"property": "og:description", "content": "some discription of shared    content"}   ]} /> 

this add meta tags per requirement.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -