【发布时间】:2019-01-26 18:56:36
【问题描述】:
在我的 react-native 应用程序中,我试图循环使用不同 ID 的图像并将它们显示在我的屏幕上,我得到了正确的 id,但是当我尝试循环它们并将它们显示在我的 FlatList 中时,只有带有最后一个 id 无限显示,这是我的循环:
IDs.forEach(async (element) => {
imagesList = await this.getImagePreview(element);
this.setState({images: imagesList });
});
【问题讨论】:
标签: javascript react-native foreach