Skip to content

Bug - [Modal] - [TypeScript typing is wrong] #10361

@jelly

Description

@jelly

Describe the problem

Modal

How do you reproduce the problem?

The TypeScript type for a Modal's title is a string while passing a React component, so now that we converted part of our code to TypeScript the type check complains:

<Modal
    title={<>this is some <b>text</b></>}

The title ends up being passed from Modal to ModelContent to ModalBoxTitle which does accept a React.ReactNode.

  /** Content rendered inside the modal box title. */
  title: React.ReactNode;

Expected behavior

No typing error

Is this issue blocking you?

No

What is your product and what release date are you targeting?

Cockpit

Any other information?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions