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
[!] (plugin rpt2) Error: /home/b3kay/jobb/astrazeneca/csp-frontend/packages/csp-web-ui/src/components/MenuItem/MenuItem.tsx(4,65): semantic error TS2769: No overload matches this call.
The last overload gave the following error.
Type '{ alignItems?: "flex-start" | "center" | undefined; autoFocus?: boolean | undefined; button?: boolean | undefined; ContainerComponent?: "object" | "abbr" | "address" | "article" | ... 76 more ... | undefined; ... 266 more ...; css?: InterpolationWithTheme<...>; }' is not assignable to type '{ button?: true | undefined; }'.
Types of property 'button' are incompatible.
Type 'boolean | undefined' is not assignable to type 'true | undefined'.
Type 'false' is not assignable to type 'true | undefined'.
I'm building a component library and want to export Material-ui components from there as a middle layer instead of direct from Material-ui.
Other components work for example:
import { InputLabel as MuiInputLabel, InputLabelProps } from '@material-ui/core';
export const InputLabel = (props: InputLabelProps): JSX.Element => <MuiInputLabel {...props} />;
Your Environment 🌎
It doesn't seem to be environment dependant. Get the same error in the sandbox.
Tech
Version
Material-UI
v4.9.14
React
v16.11.0
"rollup-plugin-typescript2
^0.27.0
The text was updated successfully, but these errors were encountered:
@B3Kay Thanks for the reproduction.
This issue could be part of a large issue we have with extending component. The Slider has a similar one in #20191.
Summary
Trying to export MenuItem from my own lib, but get typescript: semantic error TS2769.
Current Behavior 😯
Code:
Èrror on compile:
Expected Behavior 🤔
Should not give an error...
Steps to Reproduce 🕹
Material-recommended Codesandbox:
https://codesandbox.io/s/goofy-mcclintock-tz9z9?file=/src/MenuItem.tsx
CRA Typescript sandbox:
https://codesandbox.io/s/react-typescript-82spk?file=/src/MenuItem.tsx:0-203
Context 🔦
I'm building a component library and want to export Material-ui components from there as a middle layer instead of direct from Material-ui.
Other components work for example:
Your Environment 🌎
It doesn't seem to be environment dependant. Get the same error in the sandbox.
The text was updated successfully, but these errors were encountered: