Skip to content

Consider Special Casing Certain DOM Attributes to Accept Elements #6325

@sebmarkbage

Description

@sebmarkbage

The use case is for example, translation components rendering string content.

The HTML spec has some unfortunate attributes that behave kind of like content. It seems like they should be able to accept React elements. If I were to design a similar React component I would allow it to accept React elements.

Since we normalize usage we could in theory have it built-in to React that certain attributes like placeholder, aria-label, etc. could accept React components that render into strings.

That would probably have to go in after we figure out a way to render strings at the root of a React composite component.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions