Closed kvindascr closed 7 years ago
Im closing this issue. Most of my issues have fixed by using @types/react@16.0.5 Although on runtime Im not running that version, which seems to the be the same configuration at the material-ui project. Seems that the typings rely heavily on react@16.0.x typings, which seems difficult to migrate them back to 15.x.
When trying to compile a react 15 project with Typescript and MaterialUI 1.0.0-beta, typescript found inconsistencies on typings defined.
Expected Behavior
Material-ui, react15 and typescript should be able to compile properly.
Current Behavior
Typescript is not able to compile due to several typing / descriptor inconsistencies. First according to material-ui package descriptor, material-ui should be compatible with both react 15 and react 16.
Some of typings for example of Table component seems to rely on react 16 definitions, and in order to be compatible with react 15 this should not occur.
Example errors:
.../material-ui/Tooltip/Tooltip.d.ts (4,18): error TS2430: Interface 'TooltipProps' incorrectly extends interface 'HTMLAttributes<HTMLDivElement>'. Types of property 'label' are incompatible. Type 'ReactNode' is not assignable to type 'string | undefined'. Type 'null' is not assignable to type 'string | undefined'.
.../material-ui/Table/TableCell.d.ts (17,11): error TS2694: Namespace 'React' has no exported member 'ThHTMLAttributes'.
.../material-ui/Table/Table.d.ts (5,17): error TS2694: Namespace 'React' has no exported member 'TableHTMLAttributes'.
.../material-ui/Snackbar/SnackbarContent.d.ts (5,18): error TS2430: Interface 'SnackbarContentProps' incorrectly extends interface 'PaperProps'. Types of property 'action' are incompatible. Type 'ReactElement<any> | undefined' is not assignable to type 'string | undefined'. Type 'ReactElement<any>' is not assignable to type 'string | undefined'. Type 'ReactElement<any>' is not assignable to type 'string'.
Steps to Reproduce (for bugs)
Context
Project do not build. ## Your Environment