I don't think that can be changed, but the velocity seems can be adjusted from stiffness and damping
, https://github.com/chenglou/react-motion/issues/265
You can try a helper to figure out those values, http://chenglou.github.io/react-motion/demos/demo5-spring-parameters-chooser/
The trouble seems to me is the mount /dismount issue, but if you don't care, you could just setmount
to be false.
const Fade = ({
Style, on, mount, children
}) => {
const [animating, setAnimating] = useState(true)
const onRest = () => { setAnimating(false) }
useEffect(() => { setAnimating(true) }, [on])
if (mount) {
if (!on && !animating) {
return null
}
}
return (
<Style
on={on}
onRest={onRest}
>
{children}
</Style>
)
}
Fade.propTypes = {
Style: elementType,
on: bool,
mount: bool,
}