Skip to content

[Bug]: type check for renderIcon in Search component is failed #14585

Closed

Description

Package

@carbon/react, carbon-components-react

Browser

No response

Package version

v8.37.0

React version

v18

Description

Hi team,
I'm using the DataTable and enable the search bar on it.
So in the toolbar, I used the TableToolbarSearch component, which is like:

<TableToolbarSearch  renderIcon={<Search />} />

and is a customized svg, but met an error:
image

Debug result: I guess this is because the props type of CustomerSearchIcon about the icon is not the same as the renderIcon type of Search component.

BTW, I'm using @types/carbon-components-react, I guess the issue is caused by the package for typescript is not updated.

Thanks team! Looking forward the response.

Reproduction/example

N/A

Steps to reproduce

  • use typescript
  • use carbon-components-react
  • pass svg like this <TableToolbarSearch renderIcon={} />

Suggested Severity

None

Application/PAL

No response

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions