Skip to content
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

[Chip] Variant typescript error #45091

Closed
shifoc opened this issue Jan 22, 2025 · 2 comments
Closed

[Chip] Variant typescript error #45091

shifoc opened this issue Jan 22, 2025 · 2 comments
Assignees
Labels
component: chip This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information typescript

Comments

@shifoc
Copy link

shifoc commented Jan 22, 2025

Steps to reproduce

 <Chip variant="outlined" color="warning" />

Current behavior

No overload matches this call.
Overload 1 of 2, '(props: { component: ElementType<any, keyof IntrinsicElements>; } & ChipOwnProps & CommonProps & Omit<any, "className" | ... 15 more ... | "variant">): Element | null', gave the following error.
Type '"outlined"' is not assignable to type '"positive" | "negative" | undefined'.
Overload 2 of 2, '(props: DefaultComponentProps<ChipTypeMap<{}, "div">>): Element | null', gave the following error.
Type '"outlined"' is not assignable to type '"positive" | "negative" | undefined'.

Expected behavior

no error

Context

No response

Your environment

System:
OS: Windows 10 10.0.19045
Binaries:
Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
pnpm: Not Found
Browsers:
Chrome: Not Found
Edge: Chromium (127.0.2651.74)
npmPackages:
@emotion/react: ^11.13.5 => 11.13.5
@emotion/styled: ^11.13.5 => 11.13.5
@mui/base: 5.0.0-beta.40
@mui/core-downloads-tracker: 5.16.14
@mui/icons-material: ^5.16.14 => 5.16.14
@mui/lab: 5.0.0-alpha.173
@mui/material: ^5.16.14 => 5.16.14
@mui/private-theming: 5.16.14
@mui/styled-engine: 5.16.14
@mui/system: 5.16.14
@mui/types: 7.2.19
@mui/utils: 5.16.14
@mui/x-date-pickers: 5.0.20
@types/react: ^18.3.12 => 18.3.12
react: ^18.3.1 => 18.3.1
react-dom: ^18.3.1 => 18.3.1
typescript: ^4.9.5 => 4.9.5

Search keywords: chip

@shifoc shifoc added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 22, 2025
@zannager zannager added the component: chip This is the name of the generic UI component, not the React module! label Jan 23, 2025
@aarongarciah
Copy link
Member

@shifoc please provide a full example (codesandbox, repository, etc.). It looks like you might be working on a project that has customized the Chip variant type? The error says:

Type '"outlined"' is not assignable to type '"positive" | "negative" | undefined'.

but "positive" | "negative" are not part of the variant prop in the Chip component: https://mui.com/material-ui/api/chip/#chip-prop-variant

@aarongarciah aarongarciah added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 23, 2025
@aarongarciah aarongarciah changed the title Chip variant triggering typescript error [Chip] Variant typescript error Jan 23, 2025
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: chip This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information typescript
Projects
None yet
Development

No branches or pull requests

4 participants