我想让用户从我的网站分享图像到twitter .
我使用此模块react-share来实现此功能 . 但它没有提供共享图像的选项 .
我的代码看起来像这样 .
import { ShareButtons, ShareCounts, generateShareIcon, } from 'react-share';
const {
FacebookShareButton,
GooglePlusShareButton,
LinkedinShareButton,
TwitterShareButton,
PinterestShareButton,
VKShareButton,
} = ShareButtons;
<TwitterShareButton
url={shareUrl}
title={title}
className="shareBtn col-md-1 col-sm-1 col-xs-1">
<a className="twitter"><i className="fa fa-twitter" aria-hidden="true"></i></a>
</TwitterShareButton>
请帮助我解决如何将图像分享到Twitter .
2 回答
您无法使用此小部件向twitter分享丰富的内容,只能通过静态网址托管您的图片并通过
TwitterShareButton
分享该网址示例react-share code snippet at https://samvikshana.weebly.com/blog/react-share-social-share-widgets
请在您的代码中添加
<TwitterIcon>