#Component cannot be used as JSX in Next13

2 messages · Page 1 of 1 (latest)

hollow plume
#

I am using Next13s appDir and my component (serverSide) shows an error "CardComponent" cannot be used as a JSX component. Its return type 'Promise<Element>' is not valid JSX element. Type 'Promise<Element> is missing following properties from type 'ReactElement<any, any>': type, props, key it is still working tho...

daring rock
#

Thats fine, the react types havent been updated yet to support async components. I would just use @ts-expect-error

<> 
  { /* @ts-expect-error react types */ }
  <AsyncComponent />
<>