我正在尝试并行执行async / await调用,而不是一个接一个地进行,但出现以下错误。 我该如何解决?
QString str(QByteArray(elf, length_of_elf));
以下代码可以正常工作
Error: Element type is invalid: expected a string (for built-in components)
or a class/function (for composite components) but got: undefined.
You likely forgot to export your component from the file it's defined in,
or you might have mixed up default and named imports.
下面的代码给出了错误
state = {}
async componentDidMount () {
const global = await fetchSummary()
const countries = await fetchSummaryByCountry()
const dailyData = await fetchCountryHistory()
const accessedCountry = await fetchCountryName()
this.setState({
global: { ...global },
dailyData: dailyData,
accessedCountry: accessedCountry,
countries: countries
})
}
奇怪的是,两个代码都正确地传递了props,但是上面的代码会产生错误,并且页面无法呈现。 另外,有没有更好的方法来解决这个问题?
预先感谢您抽出宝贵的时间。