You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We noticed TypeScript switches the order of the union type members in the error message. And we hope someone can shine a light on this. The error is for React Ref type.
The error message used to be:
"Type 'Ref<unknown>' is not assignable to type 'string | RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined'."
Now it becomes: (RefObject and ((instance: HTMLDivElement | null) => void) switches)
Type 'Ref<unknown>' is not assignable to type 'string | ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined
We did not change relevant code, but did add react-transition-group dependency.
What puzzles me is in @types/react, the ref type is defined as:
type Ref<T> = { bivarianceHack(instance: T | null): void }["bivarianceHack"] | RefObject<T> | null;
Why the order of the bivarianceHack and RefObject would switch all of sudden?
The text was updated successfully, but these errors were encountered:
We noticed TypeScript switches the order of the union type members in the error message. And we hope someone can shine a light on this. The error is for React Ref type.
The error message used to be:
Now it becomes: (RefObject and ((instance: HTMLDivElement | null) => void) switches)
We did not change relevant code, but did add
react-transition-group
dependency.What puzzles me is in @types/react, the ref type is defined as:
Why the order of the bivarianceHack and RefObject would switch all of sudden?
The text was updated successfully, but these errors were encountered: