Hi
I would like to ask a question about Vibe components in Vite project with React and Typescript.
When I try to render any component from monday-ui-react-core
package, I receive this kind of error in IDE:
'Button' cannot be used as a JSX component.
Its type '((VibeComponent<ButtonProps & RefAttributes<unknown>, unknown> & Partial<{ sizes: { readonly SMALL: "small"; readonly MEDIUM: "medium"; readonly LARGE: "large"; readonly XXS: "xxs"; readonly XS: "xs"; }; colors: typeof ButtonColor; kinds: typeof ButtonType; types: typeof ButtonInputType; inputTags: typeof ButtonInpu...' is not a valid JSX element type.
Type 'VibeComponent<ButtonProps & RefAttributes<unknown>, unknown> & Partial<{ sizes: { readonly SMALL: "small"; readonly MEDIUM: "medium"; readonly LARGE: "large"; readonly XXS: "xxs"; readonly XS: "xs"; }; colors: typeof ButtonColor; kinds: typeof ButtonType; types: typeof ButtonInputType; inputTags: typeof ButtonInputT...' is not assignable to type 'ElementType'.
Type 'VibeComponent<ButtonProps & RefAttributes<unknown>, unknown> & Partial<{ sizes: { readonly SMALL: "small"; readonly MEDIUM: "medium"; readonly LARGE: "large"; readonly XXS: "xxs"; readonly XS: "xs"; }; colors: typeof ButtonColor; kinds: typeof ButtonType; types: typeof ButtonInputType; inputTags: typeof ButtonInputT...' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>> | null' is not assignable to type '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)
These are the project dependencies:
"dependencies": {
"monday-sdk-js": "^0.5.5",
"monday-ui-react-core": "^2.116.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
},
"devDependencies": {
...,
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"typescript": "^5.5.2",
"vite": "^5.3.1"
}
It seems that since @types/react: ^18.2.8
there is the incompatibility with Vibe components, but when downgrading to earlier versions other JSX type issues come up.
Is there any solution to get rid of those errors?