Repository navigation
Replies: 2 comments
|
I created a new project from the TypeScript template and added the one file. This demonstrates the problem of invalid usage via JSX but ok using function syntax. |
0 replies
|
Same problem using React. Type errors using JSX syntax but compiles fine in function syntax. Will try to get help from React community. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm writing a simple component that compiles fine on my computer if I call the function using regular function syntax. But if I try to use the component in JSX, I get a TypeScript error. Why the difference? I really want to be able to use this component using JSX syntax.
I've included a playground link. But to make things even more confusing, the playground isn't happy with either usage. So somehow there is a difference between how TypeScript is configured on my computer and the playground. My computer seems to be doing the right thing, as is based on the TypeScript template I installed a couple days ago; I don't think I modified the tsconfig.json.
playground
All reactions