import React, { Component } from 'react'; import { Layer } from 'recharts'; export default class Demo extends Component { static displayName = 'SankeyLinkDemo'; state = { fill: 'url(#linkGradient)', } render() { const { sourceX, targetX, sourceY, targetY, sourceControlX, targetControlX, linkWidth, index, } = this.props; const { fill } = this.state; return ( { this.setState({ fill: 'rgba(0, 136, 254, 0.5)' }); }} onMouseLeave={() => { this.setState({ fill: 'url(#linkGradient)' }); }} /> ); } }