Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with jsx types #1593

Open
nitedani opened this issue Dec 14, 2023 · 0 comments
Open

Issue with jsx types #1593

nitedani opened this issue Dec 14, 2023 · 0 comments

Comments

@nitedani
Copy link

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
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant