Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
^4.22.3
Stencil Framework Output Target
React
Stencil Framework Output Target Version
^0.8.2
Current Behavior
'MyComponent' cannot be used as a JSX component.
Its type 'StencilReactComponent<MyComponent, MyComponentEvents>' is not a valid JSX element type.
Type 'ForwardRefExoticComponent<Omit<HTMLAttributes, keyof MyComponentEvents | "age" | "favoriteKidName" | "first" | "kidsNames" | "last" | "middle"> & EventListeners<...> & Partial<...> & RefAttributes<...>>' is not assignable to type '(props: any) => ReactNode | Promise'.
Type 'ReactNode' is not assignable to type 'ReactNode | Promise'.
Type 'ReactElement<any, string | JSXElementConstructor>' is not assignable to type 'ReactNode | Promise'.
Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor>' but required in type 'ReactPortal'.ts(2786)
index.d.ts(387, 9): 'children' is declared here.
Expected Behavior
Fix error to perform build
The exact same config without hydrate is working correctly on react.
Steps to Reproduce
reactOutputTarget({
stencilPackageName: "..",
customElementsDir: "web-components",
outDir: "../../packages/component-library/react",
}),//worked
reactOutputTarget({
stencilPackageName: "..",
customElementsDir: "web-components",
outDir: "../../packages/component-library/next",
hydrateModule: "../hydrate",
}),//thrrow error
{
type: "dist-custom-elements",
externalRuntime: false,
dir: "../../packages/component-library/web-components",
},
{
type: "dist-hydrate-script",
dir: "../../packages/component-library/hydrate",
},
error: 'MyComponent' cannot be used as a JSX component.
Its type 'StencilReactComponent<MyComponent, MyComponentEvents>' is not a valid JSX element type.
Type 'ForwardRefExoticComponent<Omit<HTMLAttributes, keyof MyComponentEvents | "age" | "favoriteKidName" | "first" | "kidsNames" | "last" | "middle"> & EventListeners<...> & Partial<...> & RefAttributes<...>>' is not assignable to type '(props: any) => ReactNode | Promise'.
Type 'ReactNode' is not assignable to type 'ReactNode | Promise'.
Type 'ReactElement<any, string | JSXElementConstructor>' is not assignable to type 'ReactNode | Promise'.
Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor>' but required in type 'ReactPortal'.ts(2786)
index.d.ts(387, 9): 'children' is declared here.
Code Reproduction URL
Additional Information
No response