share` libraryto use Facebook share button with react 这是代码
render(){
var url = `http://localhost:3000/${this.props.match.params.id}/${this.props.match.params.name}`
return (
{/*some other codes*/}
<FacebookShareButton url={url} quote={"გააზიარე"} className="share">
<FacebookIcon size={32} round={true}/>
</FacebookShareButton>
)
}
但它不起作用,我的意思是它打开 facebook 窗口但显示一些错误 关于域名,我认为这个问题很常见,因为我根据文档做了一切。什么是问题?
您不能共享
localhost
链接,该链接仅在您自己的计算机上可用。 Facebook 需要公开访问共享的 URL。
更新:
Facebook 现在显示一条错误消息说“localhost won't work”。