diff --git a/packages/sankey/src/SankeyLinksItem.js b/packages/sankey/src/SankeyLinksItem.js index e432735eb..c6fc3ad0f 100644 --- a/packages/sankey/src/SankeyLinksItem.js +++ b/packages/sankey/src/SankeyLinksItem.js @@ -9,7 +9,7 @@ import React, { memo, useCallback, useMemo } from 'react' import PropTypes from 'prop-types' import { useSpring, animated } from 'react-spring' -import { blendModePropType, useMotionConfig } from '@nivo/core' +import { blendModePropType, useAnimatedPath, useMotionConfig } from '@nivo/core' import { BasicTooltip, Chip, useTooltip } from '@nivo/tooltip' import SankeyLinkGradient from './SankeyLinkGradient' @@ -73,8 +73,8 @@ const SankeyLinksItem = ({ const linkId = `${link.source.id}.${link.target.id}` const { animate, config: springConfig } = useMotionConfig() + const animatedPath = useAnimatedPath(path) const animatedProps = useSpring({ - path, color, opacity, config: springConfig, @@ -130,7 +130,7 @@ const SankeyLinksItem = ({ )}