尝试分配给readonly属性以响应本机错误

时间:2020-04-04 07:39:35

标签: javascript reactjs react-native

我具有以下(切换)功能:

toggleMenu = () => {
    const toValue = this.open ? 0 : 1;
    Animated.spring(this.animation, {
      toValue,
      friction: 5,
    }).start();
    this.open = !this.open;
  };

我收到“尝试分配给只读属性”错误。有人可以解释这是为什么以及如何解决吗?谢谢!

0 个答案:

没有答案