export const Filter = async (): Promise<JSX.Element> => { const { data: categories } = await api.get('/categories/') return ( <div className='w-full h-full relative'> <Container className='sticky top-[6rem] max-lg:col-span-2'> <div className='grid grid-cols-1 gap-6 max-h-[40rem] overflow-y-scroll overflow-hidden'> There is the problem i think <Container className='flex items-center flex-col'> <SmallHeading>Kategoria</SmallHeading> <ul className='grid grid-cols-1 gap-4 max-h-[25rem] overflow-y-scroll overflow-hidden w-full'> {categories.map(c => { return <CategoryItem key={c.id} href={c.name} name={c.name} image={c.img} isSmall={true} /> })} </ul> </Container> </div> </Container> </div> ) }
'Filter' cannot be used as a JSX component. Its return type 'Promise' is not a valid JSX element. Type 'Promise' is missing the following properties from type 'ReactElement<any, any>': type, props, key
Help i'll try everythink
I tried what is in the code I gave above, I don't understand why such an error appear