The following code in not compiling anymore in mui v4.0:
<ListItem button={editable} >
<ListItemText primary="text" />
</ListItem>
where editable is a boolean value.
Expected Behavior 🤔
Should compile without error.
Current Behavior 😯
Type 'boolean' is not assignable to type 'true'.
button={editable}
../../../node_modules/@material-ui/core/ListItem/ListItem.d.ts:23:38
23 ExtendButtonBase<ListItemTypeMap<{ button: true }, 'div'>>;
The expected type comes from property 'button' which is declared here on type 'IntrinsicAttributes & { action?: ((actions: ButtonBaseActions) => void) | undefined; buttonRef?: ((instance: any) => void) | RefObject | null | undefined; centerRipple?: boolean | undefined; ... 6 more ...; TouchRippleProps?: Partial<...> | undefined; } & { ...; } & { ...; } & CommonProps<...> & Pick<...>'
Your Environment 🌎
| Tech |
Version |
| Material-UI |
4.0.0-alpha.4 |
| React |
16.8.4 |
| @types/react |
16.8.8 |
| TypeScript |
3.3.3333 |
The following code in not compiling anymore in mui v4.0:
where
editableis a boolean value.Expected Behavior 🤔
Should compile without error.
Current Behavior 😯
Type 'boolean' is not assignable to type 'true'.
button={editable}
../../../node_modules/@material-ui/core/ListItem/ListItem.d.ts:23:38
23 ExtendButtonBase<ListItemTypeMap<{ button: true }, 'div'>>;
The expected type comes from property 'button' which is declared here on type 'IntrinsicAttributes & { action?: ((actions: ButtonBaseActions) => void) | undefined; buttonRef?: ((instance: any) => void) | RefObject | null | undefined; centerRipple?: boolean | undefined; ... 6 more ...; TouchRippleProps?: Partial<...> | undefined; } & { ...; } & { ...; } & CommonProps<...> & Pick<...>'
Your Environment 🌎