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

Please add in the documentation the syntax for Typescript arrow functions with generics and how to avoid ambiguity with JSX using a trailing comma #3196

Open
adriancuadrado opened this issue Jul 30, 2024 · 0 comments

Comments

@adriancuadrado
Copy link
Contributor

adriancuadrado commented Jul 30, 2024

Page URL: https://www.typescriptlang.org/docs/handbook/2/generics.html

Issue: What is the syntax for Typescript arrow functions with generics?

The typescript handbook currently has nothing on arrow functions.

Thomas said this in a comment:

Newer typescript compilers also support trailing comma const foo = <T,>(x: T) => x; to sidestep the JSX ambiguity

If you add this info in the documentation people won't have to resort to that StackOverflow post to discover these features.

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

2 participants
@adriancuadrado and others