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
My UI is failing to compile because of a TS2344 error in file @material-ui/core/TextField/TextField.d.ts, in detail:
(11,62): error TS2344: Type '"defaultValue" | "onChange"' does not satisfy the constraint '"classes" | "component" | "innerRef" | "className" | "style" | "margin" | "disabled" | "fullWidth...'.
Type '"defaultValue"' is not assignable to type '"classes" | "component" | "innerRef" | "className" | "style" | "margin" | "disabled" | "fullWidth...'.
I had the same issue in the past with a beta version, and I solved thanks to Material-ui-next typescript error, but same trick didn't work. I also tried to copy and paste the configuration from the stack overflow answer, but npm wasn't able to find that exact versions of the packages.
Checking the file TextField.d.ts and following FormControlProps declaration coming from file FormControl.d.ts, I noticed an error "[ts] Type 'ReactType' is not generic." on the declaration component?: React.ReactType<FormControlProps>;, don't know if that's the triggering cause.
This is the first time I use v1 of Material-UI (since 0.xx is not supported anymore), I tried different version combinations for @material-ui/core (1.0.0, 1.1.0) and react / react-dom / @types/react / @types/react-dom (different v16 releases, v15 too out of desperation), no luck with any combination.
Any idea?
The text was updated successfully, but these errors were encountered:
It looks like this is caused by an update to typescript itself and has been fixed here, but not published yet: #11656
There's a workaround in that issue that I just tried out in the mean time, and it works. I have a new app created with create-react-app, installed the latest material-ui, and added { "compilerOptions": { "keyofStringsOnly": true } }, and no more problem.
My UI is failing to compile because of a TS2344 error in file
@material-ui/core/TextField/TextField.d.ts
, in detail:I had the same issue in the past with a beta version, and I solved thanks to Material-ui-next typescript error, but same trick didn't work. I also tried to copy and paste the configuration from the stack overflow answer, but npm wasn't able to find that exact versions of the packages.
Checking the file TextField.d.ts and following
FormControlProps
declaration coming from file FormControl.d.ts, I noticed an error "[ts] Type 'ReactType' is not generic." on the declarationcomponent?: React.ReactType<FormControlProps>;
, don't know if that's the triggering cause.At the moment package.json looks like:
This is the first time I use v1 of Material-UI (since 0.xx is not supported anymore), I tried different version combinations for @material-ui/core (1.0.0, 1.1.0) and react / react-dom / @types/react / @types/react-dom (different v16 releases, v15 too out of desperation), no luck with any combination.
Any idea?
The text was updated successfully, but these errors were encountered: