React-share: Pintrest share button not working

92 Views Asked by At

i am using react-share library version 5.0.3. i have used pintrest share button but it just opening pintrest page but the shared image is not getting attached there.

sample code:

let link = https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg

    <PinterestShareButton media={link} url={link}>
            <PinterestIcon size={35} round={true} />
    </PinterestShareButton>

on pintrest it just shows like this enter image description here

How to resolve this or what can be the fix.

2

There are 2 best solutions below

0
On BEST ANSWER

This can be fixed by giving description prop to the pintrest button component line this

<PinterestShareButton
          url={link}
          media={link}
         description={"description of the image"}
        >

And then it will open image attached pintrest popup.

7
On

I have created a working button. Could you please check if it's what you need?

code