Javascript 如何从重新限制的值中获取数值?

Javascript 如何从重新限制的值中获取数值?,javascript,reactjs,react-native,victory-charts,react-native-reanimated,Javascript,Reactjs,React Native,Victory Charts,React Native Reanimated,我使用react native reanimated创建了一个简单的动画,但无法访问reanimated value的数值 我使用victory native饼图,我想做一个简单的效果,饼图角度从0到360,但我尝试了react native动画API它与add listener配合得很好,但我想使用reanimated来解决性能问题 我正在寻找的动画效果是图表从0到360开始 使用react本机动画API正确运行: const Chart=props=>{ 常量{data,width,heig

我使用react native reanimated创建了一个简单的动画,但无法访问reanimated value的数值

我使用victory native饼图,我想做一个简单的效果,饼图角度从0到360,但我尝试了react native动画API它与add listener配合得很好,但我想使用reanimated来解决性能问题

我正在寻找的动画效果是图表从0到360开始

使用react本机动画API正确运行:

const Chart=props=>{
常量{data,width,height}=props;
const endAngleAnimatedValue=新值(0);
const[endAngle,setEndAngle]=useState(0);
const runTiming=Animated.timing(endAngleAnimatedValue{
持续时间:1000,
收件人:360
});
useffect(()=>{
addListener(_endAngle=>setEndAngle(_endAngle));
runTiming.start();
return()=>{
endAngleAnimatedValue.removeAllListeners();
};
},[endAngleAnimatedValue]);
返回(
数据填充,
填充不透明度:0.7
}
}}
/>
);
};

我怎样才能通过“复活”达到预期的输出?

我完全忘记了这个问题

如果使用react native reanimated v1:

1. using react-native-svg and some helpers from react-native-redash

2. using `const AnimatedPie = Animated.createAnimatedComponent(VictoryPie)` then passing `endAngleAnimatedValue` as a prop.
在复活v2中:

1. using react-native-svg and some helpers from react-native-redash

2. using `const AnimatedPie = Animated.createAnimatedComponent(VictoryPie)` then passing `endAngleAnimatedValue` as a prop.
您可以显式地使用
.value
来创建动画
共享值、派生值
,但也必须创建动画组件