<PinterestShareButton url={localHostShareUrl}> <PinterestIcon size={35} round={true} /> </PinterestShareButton>
我用这个组件来分享博客。我使用 facebook、twitter、linkedin 和 pininterst 组件使用 react-share。但是当我点击 pininterest 按钮时,它不会弹出共享框,但其他平台工作顺利。任何人都可以帮助我解决这个问题问题。这是包裹的问题吗?
您需要在 PinterestShareButton 中包含“url”和“media”参数才能创建弹出窗口。
<PinterestShareButton url={url} media={url} description="">
<PinterestIcon />
</PinterestShareButton>
https://www.npmjs.com/package/react-share
对于所有 React 分享按钮,URL 是强制性的,对于 PinterestShareButton,它也需要 media prop。