Describe the bug
The problems appear on next build and seem to be related to all theme-ui/Box components:
./src/components/cards/Post.tsx:33:18
Type error: 'Heading' cannot be used as a JSX component.
Its return type 'ReactNode' is not a valid JSX element.
Screenshots
This is what might cause the error:
|
return <Component ref={ref} css={style} {...rest} /> |
'Component' cannot be used as a JSX component.
Its element type 'ReactElement<any, any> | Component<any, any, any> | null' is not a valid JSX element.
Type 'Component<any, any, any>' is not assignable to type 'Element | ElementClass | null'.
Type 'Component<any, any, any>' is not assignable to type 'ElementClass'.
The types returned by 'render()' are incompatible between these types.
Type 'React.ReactNode' is not assignable to type 'import("/media/anton/Enterprise1/nesterov.digital/node_modules/@types/react/index").ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.ts(2786)
Additional context
- OS: Ubuntu 22.10
- NodeJS v18.16.0
package.json:
"next": "13.4.4"
"@types/node": "20.2.5"
"@types/react": "18.2.8"
"@types/react-dom": "18.2.4"
tsconfig.json
"jsxImportSource": "theme-ui",
Describe the bug
The problems appear on
next buildand seem to be related to alltheme-ui/Boxcomponents:Screenshots
This is what might cause the error:
theme-ui/packages/components/src/Box.tsx
Line 134 in 6495a0a
Additional context
package.json:tsconfig.json