Skip to content

Type errors when using exactOptionalPropertyTypes #45106

@alexwork1611

Description

@alexwork1611

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/edit/react-material-ui-typescript-xksrbck9?file=components%2FApp.tsx
  2. Look at the Autocomplete in App.tsx and at tsconfig.json
  3. See that the TextField in the renderInput param errors out

Current behavior

Image

Image

Expected behavior

No type error

Context

No response

Your environment

npx @mui/envinfo
System:
    OS: Windows 11 10.0.22631
  Binaries:
    Node: 22.11.0 - C:\nvm4w\nodejs\node.EXE
    npm: 10.9.0 - C:\nvm4w\nodejs\npm.CMD
    pnpm: 9.15.3 - C:\ProgramData\chocolatey\bin\pnpm.EXE
  Browsers:
    Chrome: Not Found
    Edge: Chromium (127.0.2651.98)

Search keywords: exactOptionalPropertyTypes

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists.scope: all componentsWidespread work has an impact on almost all components.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions