We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As an example, in this challenge: src/05-generics/39-generic-props.problem.tsx.
src/05-generics/39-generic-props.problem.tsx
This happens in all challenges involving a single unconstrained type argument in a TSX file (which admittedly doesn't happen extremely often).
We need to add a comma after the T, like this:
T
-export const Table = (props: TableProps) => { +export const Table = <T,>(props: TableProps<T>) => {
However, when saving the file in StackBlitz Prettier removes the ,, making the file invalid:
,
-export const Table = <T,>(props: TableProps<T>) => { +export const Table = <T>(props: TableProps<T>) => {
Luckily, the optional way of doing this with T extends unknown works here:
T extends unknown
-export const Table = <T,>(props: TableProps<T>) => { +export const Table = <T extends unknown>(props: TableProps<T>) => {
This should have been fixed in Prettier in 2019 though, so I'm not sure why this would be happening here: prettier/prettier#6114
The text was updated successfully, but these errors were encountered:
This just got me again, in https://github.com/total-typescript/react-typescript-tutorial/blob/main/src/08-advanced-patterns/66-forward-ref-as-local-function.problem.tsx I added the expected types at the top and then when saving the <T,> was changed to <T> for the declaration for Table further down the file, causing syntax errors.
<T,>
<T>
Table
Sorry, something went wrong.
No branches or pull requests
As an example, in this challenge:
src/05-generics/39-generic-props.problem.tsx
.This happens in all challenges involving a single unconstrained type argument in a TSX file (which admittedly doesn't happen extremely often).
We need to add a comma after the
T
, like this:However, when saving the file in StackBlitz Prettier removes the
,
, making the file invalid:Luckily, the optional way of doing this with
T extends unknown
works here:This should have been fixed in Prettier in 2019 though, so I'm not sure why this would be happening here: prettier/prettier#6114
The text was updated successfully, but these errors were encountered: