由于错误而无法从本机库渲染SwipeRow:“ TypeError:undefined不是一个对象(正在评估'this_panResponder.panHandlers”)

时间:2019-10-09 12:05:20

标签: javascript react-native native-base

我正在使用来自本机的SwipeRow,一切都很好,但是当我在移动设备上运行该应用程序时,显示typeError“ TypeError:undefined is an object(evaluating'this_panResponder.panHandlers”。),我找不到该错误。任何人都想帮助解决此问题。在此先感谢

enter image description here

这是SwipeRow类

class CartItem extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    return (
      <View>
        <SwipeRow
          leftOpenValue={75}
          rightOpenValue={-75}
          left={
            <Button success onPress={() => alert("Add")}>
              <Icon active name="add" />
            </Button>
          }
          body={
            <View>
              <Text>SwipeRow Body Text</Text>
            </View>
          }
          right={
            <Button danger onPress={() => alert("Trash")}>
              <Icon active name="trash" />
            </Button>
          }
        />
      </View>
    );
  }
}

export default CartItem;

这是我渲染CartItem的类

class Cart extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    return (
      <View>
        <HeaderContainer navigation={this.props.navigation} />
        <View style={styles.parentView}>
          <Content>
            <CartItem title={"Burger"} />
            <CartItem title={"PiZZA"} />
            <CartItem title={"COFFEE"} />
            <CartItem title={"BREAD"} />
          </Content>
          <View style={styles.footerContainer}>
            <Text style={styles.totalPriceStyle}>Total:</Text>
          </View>
        </View>
      </View>
    );
  }
}

export default Cart;

0 个答案:

没有答案