mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
@@ -438,7 +438,7 @@ function isCustomComponent(tagName, props) {
|
||||
*/
|
||||
function ReactDOMComponent(tag) {
|
||||
validateDangerousTag(tag);
|
||||
this._tag = tag;
|
||||
this._tag = tag.toLowerCase();
|
||||
this._renderedChildren = null;
|
||||
this._previousStyle = null;
|
||||
this._previousStyleCopy = null;
|
||||
@@ -533,7 +533,7 @@ ReactDOMComponent.Mixin = {
|
||||
if (!tagContent && omittedCloseTags[this._tag]) {
|
||||
return tagOpen + '/>';
|
||||
}
|
||||
return tagOpen + '>' + tagContent + '</' + this._tag + '>';
|
||||
return tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -550,7 +550,7 @@ ReactDOMComponent.Mixin = {
|
||||
* @return {string} Markup of opening tag.
|
||||
*/
|
||||
_createOpenTagMarkupAndPutListeners: function(transaction, props) {
|
||||
var ret = '<' + this._tag;
|
||||
var ret = '<' + this._currentElement.type;
|
||||
|
||||
for (var propKey in props) {
|
||||
if (!props.hasOwnProperty(propKey)) {
|
||||
|
||||
@@ -452,6 +452,16 @@ describe('ReactDOMComponent', function() {
|
||||
};
|
||||
});
|
||||
|
||||
it('should not duplicate uppercased selfclosing tags', function() {
|
||||
var Container = React.createClass({
|
||||
render: function() {
|
||||
return React.createElement('BR', null);
|
||||
},
|
||||
});
|
||||
var returnedValue = React.renderToString(<Container/>);
|
||||
expect(returnedValue).not.toContain('</BR>');
|
||||
});
|
||||
|
||||
it('should warn against children for void elements', function() {
|
||||
spyOn(console, 'error');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user