标签: javascript reactjs react-native
我具有以下(切换)功能:
toggleMenu = () => { const toValue = this.open ? 0 : 1; Animated.spring(this.animation, { toValue, friction: 5, }).start(); this.open = !this.open; };
我收到“尝试分配给只读属性”错误。有人可以解释这是为什么以及如何解决吗?谢谢!