Skip to content

Minor inconsistency: charSet JSX attribute won't get lowercased in the HTML output #21571

@axtk

Description

@axtk

Unlike other JSX attributes (e.g. contentEditable), charSet remains unchanged in the HTML output produced by the ReactDOMServer's render methods, which results in a minor inconsistency.

// `charSet` remains unchanged, while the other camel-case
// attributes are lowercased
console.log(ReactDOMServer.renderToStaticMarkup(
    <>
        <meta charSet="utf-8"/>
        <meta httpEquiv="refresh" content="3"/>
        <div contentEditable/>
    </>
));

Looks like adding ['charSet', 'charset'] to packages/react-dom/src/shared/DOMProperty.js could fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions