Skip to content

[Chip] TypeError: onClick is not a function #46262

@SolodkyRoman

Description

@SolodkyRoman

Steps to reproduce

Steps:

  1. Go to the official MUI Chip documentation.
  2. Scroll to the “Basic Chip” example or open the CodeSandbox.
  3. Click on Chip.
  4. Open the browser’s console and observe the error (CodeSandbox example will crash the page).
Uncaught TypeError: onClick is not a function
    at onClick (Chip.js:482:1)

Current behavior

Clicking on Chip without an onClick prop causes a runtime error.

Expected behavior

If no onClick handler is provided, the component should not attempt to call it.

Context

No response

Your environment

No response

Search keywords: Chip

Metadata

Metadata

Assignees

Labels

component: chipThis is the name of the generic UI component, not the React module!regression 🐛A bug, but worse

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions