小编Mat*_*ial的帖子

VirtualizedList 永远不应该嵌套在普通 ScrollView 中

当我打开 DropDown 并且无法选择或滚动 DrowDown 对话框时,我收到错误VirtualizedLists 不应该嵌套在普通 ScrollViews 中,我大约知道问题是什么,有人可以告诉我原因或向我展示解决方案吗?

<ScrollView>
  {formSchema.map((field, index) => {
    const { name, label, type } = field;
    if (type === 'select') {
      return (
        <View style={styles.sropsownWrapper} key={index}>
          <Dropdown
          />
        </View>
      );
    }
    if (type === 'input') {
      return (
        <View style={styles.wrapper}>
          <Input
            name={name}
            label={label}
          />
        </View>
      );
    }
  })}
  <View
    style={{
      ...styles.controls,
      backgroundColor: '#242424',
    }}>
    <View style={styles.wrapper}>
      <Button onPress={() => ()} />
    </View>
    <View style={styles.wrapper}>
      <Button  text="Go" />
    </View>
  </View>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)

javascript native reactjs react-native

0
推荐指数
1
解决办法
2480
查看次数

标签 统计

javascript ×1

native ×1

react-native ×1

reactjs ×1