Skip to content

DOM attribute dateTime isn't lowercased when rendered to string #11492

@larsnystrom

Description

@larsnystrom

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
The DOM property dateTime isn't converted to its lowercase attribute counterpart datetime for the <time> element when the element is rendered with ReactDOMServer.renderToString().

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).

const React = require('react');
const ReactDOMServer = require('react-dom/server');

const markup = ReactDOMServer.renderToString(React.createElement('time', {
	dateTime: "2017-11-02T20:49:25+01:00"
}));
console.log(markup);

The above will print <time dateTime="2017-11-02T20:49:25+01:00" data-reactroot=""></time>.

What is the expected behavior?

The above output should be <time datetime="2017-11-02T20:49:25+01:00" data-reactroot=""></time>.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

React 16.0.0
React DOM 16.0.0
Node v6.11.5

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