【发布时间】:2021-10-25 13:33:41
【问题描述】:
当我打开 DropDown 并且无法选择或滚动 DrowDown 对话框时,我收到错误 VirtualizedLists should never be nested inside plain 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>
【问题讨论】:
标签: javascript reactjs react-native native