-
-
Notifications
You must be signed in to change notification settings - Fork 96
TS2322: Type 'string | number | any[] | { value: any; symbol: any; exponent: number; unit: string; }' is not assignable to type 'ReactNode'. #167
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
Comments
That file is generated; tsc bug? Considering this issue is entirely imaginary, what is the suggested problem/solution? |
Yes. There is some difference between React 17 and React 18 handling of the |
does the type file for earlier versions work? the persons chose a diff structure than tsc generates. |
@avoidwork , yes. I was using filesize with react 17 and things worked just fine. |
@greenpau are you using @types/react 18.0.0? from what i'm reading this has nothing to do with filesize and simply relates to the optional object output. |
I ran into the same problem. The main problem is that the return type from the string | number | any[] | {
value: any;
symbol: any;
exponent: number;
unit: string;
}; If you want to use the result of the I was able to fix the type error by just parsing the result to a string (like |
After the upgrade to React 18, I started getting the following Typescript errors:
The text was updated successfully, but these errors were encountered: