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

Mat*_*ial 0 javascript native reactjs react-native

当我打开 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)

小智 6

文档建议添加listMode="MODAL"listMode="SCROLLVIEW"避免该问题。