Skip to content

Commit

Permalink
PP-13510: Use configuration preset to slow down value animations
Browse files Browse the repository at this point in the history
  • Loading branch information
katstevens committed Jan 16, 2025
1 parent fce8b7d commit 36c5061
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions browser/src/dashboard/Spring.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import { useSpring, animated, useTransition } from 'react-spring'
import { useSpring, animated, useTransition, config } from 'react-spring'

// this top level method has to be any type right now as of
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20356
Expand All @@ -24,9 +24,12 @@ interface ValueSpringProps {
formatter: Intl.NumberFormat
}

// Use configuration preset 'slow' to slow down the £value animations
// https://react-spring.dev/docs/advanced/config#presets
export const ValueSpring = (props: ValueSpringProps) => {
const springProps = useSpring({
value: props.value
value: props.value,
config: config.slow
})

return (
Expand Down

0 comments on commit 36c5061

Please sign in to comment.