问题描述
我正在尝试为响应本机重新激活的图标实现一些淡入和淡出过渡。它的版本是2.1.0。我正在使用expo的裸露工作流程。代码看起来像这样
...
const IconWrapper: React.FC<IconWrapperProps> = ({
wrapperStyle,children
}) => {
const [opacity,setOpacity] = useState<number>(0);
const animatedOpacity = useSharedValue(opacity);
const hookUpdater = () => {
return {
opacity: withTiming(animatedOpacity.value,{
duration: 100,easing: Easing.linear
})
};
};
const animationStyle = useAnimatedStyle(hookUpdater,[opacity]);
const hookEffect = () => {
setOpacity(1);
const cleaner = () => setOpacity(0);
return cleaner;
};
useEffect(hookEffect,[]);
return (
<Animated.View
style={[wrapperStyle,animationStyle]}
>
{children}
</Animated.View>
);
};
export default IconWrapper;
对我来说,似乎没有问题,因为我实际上做了与文档中相同的事情。但它一直在向我吐口水
TypeError: Object.values requires that input parameter not be null or undefined
我尝试用 expo start -c
重置缓存,但没有成功。我应该怎么做才能解决这个问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)