Skip to content

Commit

Permalink
feat(treemap): adjustments for react-spring@next
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Nov 16, 2020
1 parent df7d665 commit e5611c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/treemap/src/TreeMapNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ const TreeMapNodes = ({
})

const { animate, config: springConfig } = useMotionConfig()
const transitions = useTransition(interactiveNodes, node => node.path, {
const transition = useTransition(interactiveNodes, {
key: node => node.path,
initial: node => getAnimatedNodeProps(node),
from: node => getEndingAnimatedNodeProps(node),
enter: node => getAnimatedNodeProps(node),
Expand All @@ -88,9 +89,9 @@ const TreeMapNodes = ({
immediate: !animate,
})

return transitions.map(({ item: node, props: animatedProps, key }) => {
return transition((animatedProps, node) => {
return React.createElement(nodeComponent, {
key,
key: node.path,
node,
animatedProps,
borderWidth,
Expand Down

0 comments on commit e5611c3

Please sign in to comment.