Pinterest 分享按钮功能无法使用反应分享库

问题描述 投票:0回答:2

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

我用这个组件来分享博客。我使用 facebook、twitter、linkedin 和 pininterst 组件使用 react-share。但是当我点击 pininterest 按钮时,它不会弹出共享框,但其他平台工作顺利。任何人都可以帮助我解决这个问题问题。这是包裹的问题吗?

pinterest react-share
2个回答
1
投票

您需要在 PinterestShareButton 中包含“url”和“media”参数才能创建弹出窗口。

<PinterestShareButton url={url} media={url} description="">
 <PinterestIcon />
</PinterestShareButton>

0
投票

https://www.npmjs.com/package/react-share

对于所有 React 分享按钮,URL 是强制性的,对于 PinterestShareButton,它也需要 media prop

© www.soinside.com 2019 - 2024. All rights reserved.