作者:李林1108_965 | 来源:互联网 | 2023-09-15 12:32
本文由编程笔记#小编为大家整理,主要介绍了text 过渡运动反应路由器4路径转换相关的知识,希望对你有一定的参考价值。
const FadeRoute = ({ component: Component, ...rest }) => {
return (
(
willEnter={() => {return {opacity: 0, translateX: 24}}}
willLeave={() => {return {opacity: spring(0, animationPresets.out), translateX: spring(24)}}}
defaultStyles={[ {
key: location.pathname,
style: { opacity: 0, translateX: 24},
data: match
} ]}
styles={match ? [ {
key: location.pathname,
style: { opacity: spring(1, animationPresets.in), translateX: spring(0) },
data: match
} ] : []}
>
{interpolatedStyles => (
{interpolatedStyles.map(cOnfig=> (
className="page"
key={config.key}
style={{opacity: `${config.style.opacity}`, transform: `translateX(-${config.style.translateX}px)`}}
>
))}
)}
)}/>
)
}
export default FadeRoute