-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Cannot define an arrow function with a single generic type parameter that has a default value with JSX #47062
Comments
Workaround: |
We should lookahead one token here for |
Amazing! thanks :) |
I'm to dumb to use it. @giladgo Could you provide a example syntax? |
@florianmatz What do you mean? This works now: Make sure you're using TypeScript 4.6.2. |
I am experiencing the same problem on Typescript 5.1.3. Is it just me? |
Bug Report
π Search Terms
typescript
jsx
tsx
generic
arrow function
default value
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The typescript compiler throws multiple errors
π Expected behavior
I would be allowed to create an arrow function with a single type parameter that has a default value.
Note:
= string
) doesn't throw errorsT
, ie<K, T=string>
doesn't throw errorsThe text was updated successfully, but these errors were encountered: