compiled
compiled copied to clipboard
Issue with jsx types
Describe the bug
When settings "jsxImportSource": "@compiled/react", in tsconfig.json, ReactNode becomes an invalid component return type.
To Reproduce Steps to reproduce the behavior:
const ComponentA = (): React.ReactNode => {
return <div></div>;
};
const ComponentB = (): React.ReactNode => {
return (
<div>
<ComponentA />
^^^^^^
'ComponentA' cannot be used as a JSX component.
Its return type 'ReactNode' is not a valid JSX element.ts(2786)
const ComponentA: () => React.ReactNode
</div>
);
};
Expected behavior Align with the React types. ReactNode is a valid return type.
Screenshots