Skip to content

Commit

Permalink
fix(sankey): switch to useAnimatedPath hook
Browse files Browse the repository at this point in the history
  • Loading branch information
wyze committed Oct 22, 2020
1 parent d755a11 commit a5cdf26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/sankey/src/SankeyLinksItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -130,7 +130,7 @@ const SankeyLinksItem = ({
)}
<animated.path
fill={enableGradient ? `url("#${encodeURI(linkId)}")` : animatedProps.color}
d={animatedProps.path}
d={animatedPath}
fillOpacity={animatedProps.opacity}
onMouseEnter={isInteractive ? handleMouseEnter : undefined}
onMouseMove={isInteractive ? handleMouseMove : undefined}
Expand Down

0 comments on commit a5cdf26

Please sign in to comment.