我有一个异步函数: async getItems() : Promise<any[]> {} 这会获取一些数据。对Table组件的函数调用: dataSource={this.props.itemsStore.getItems()} 错误消息: Type 'Promise<any[]>' is missing thefollowing properties from type 'any[]': lengt
以下代码:async function handleErrors<Result extends Array<any>>(asyncCall: () => Promise// return [] as Result; // also does not work - needed casting to `any`/`unknown` first}
键
具有以下代码:async function fetchAPI<T>(path: string, data: any): Promise<T> {return (await axios.get(path, data)).data as T
async function getSomething(): Promise<SomeType> {return await fetchAPI<Som