这是indexloc提供的服务,不要输入任何密码
Skip to content

Bug: BarList takes data with JSX Elements, but shows type error #945

@jschuur

Description

@jschuur

Tremor Version

3.13.4

Link to minimal reproduction

n/a

Steps to reproduce

I'm setting the name property of the data array passed into a BarList to a JSX Element and this renders fine, but I get a TypeScript error because the type for data doesn't allow for Elements.

  const listData = data
    ? orderBy(
        data.map((d) => ({
          name: <Badge color={resourceColor(d.resource_type)}>{d.resource}</Badge>,
          value: d.total_cost,
        })),
        'value',
        'desc'
      )
    : [];

CleanShot 2024-02-05 at 10 00 53@2x

What is expected?

Should not show TypeScript error if it can render JSX Elements in the data.

What is actually happening?

TypeScript error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions