如何在reactjs的社交媒体上将react-chartjs-2的条形图作为图像共享?

如何在reactjs的社交媒体上将react-chartjs-2的条形图作为图像共享?,reactjs,react-chartjs-2,react-share,Reactjs,React Chartjs 2,React Share,我正在开发一个react应用程序,并使用react-chartjs-2创建了条形图。我想在社交媒体上分享这个条形图。我尝试了react共享包,但其中使用的共享按钮只允许传递url。我找不到这样做的方法 这是我的条形图代码 其中,我将数据和选项作为道具传递给类组件 import React from 'react'; import {HorizontalBar} from 'react-chartjs-2'; class BarAreaComponent extends React.PureCo

我正在开发一个react应用程序,并使用react-chartjs-2创建了条形图。我想在社交媒体上分享这个条形图。我尝试了react共享包,但其中使用的共享按钮只允许传递url。我找不到这样做的方法

这是我的条形图代码

其中,我将数据选项作为道具传递给类组件

import React from 'react';
import {HorizontalBar} from 'react-chartjs-2';

class BarAreaComponent extends React.PureComponent {

  componentRef = React.createRef();

  render() {
    return (
        <div>
            <HorizontalBar ref={this.componentRef} id="BarArea" height={600} data={this.props.data} options={this.props.options}/>
        </div>
    );
  }
}
export default BarAreaComponent;

从“React”导入React;
从'react-chartjs-2'导入{HorizontalBar};
类BarareAccomponent扩展了React.PureComponent{
componentRef=React.createRef();
render(){
返回(
);
}
}
导出默认组件;
下面是我尝试使用react share实现的共享功能的代码

import { FacebookShareButton, FacebookIcon } from "react-share"
    const currentURL = window.location.href // returns the absolute URL of a page
    <FacebookShareButton url={currentURL} >
            <FacebookIcon size={40} round />
    </FacebookShareButton>
从“react share”导入{FacebookShareButton,FacebookIcon}
const currentURL=window.location.href//返回页面的绝对URL
如何包含共享react-chartjs-2条形图的共享按钮