I have TypeScript code:
const ItemsList: React.FC<any> = async () => {
const data = await Http.get(url);
return (
<ul>
{data.map(item => {
return (
<ItemPreview key={item.id} item={item} />
);
})}
</ul>
)
}
export default ItemsList
And got error:
Type '()=>Promise<JSX.Element>' is not assingable to type 'FC'. Type 'Promise' is missing the folowing properties from type 'ReactElement<any, any>': type, props, key
Have no idea how to fix it. What type should it be instead of 'React.FC'?