mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Move isCustomComponent() function call outside of loop (#19007)
This commit is contained in:
+4
-2
@@ -73,7 +73,7 @@ import {checkControlledValueProps} from '../shared/ReactControlledValuePropTypes
|
||||
import assertValidProps from '../shared/assertValidProps';
|
||||
import dangerousStyleValue from '../shared/dangerousStyleValue';
|
||||
import hyphenateStyleName from '../shared/hyphenateStyleName';
|
||||
import isCustomComponent from '../shared/isCustomComponent';
|
||||
import isCustomComponentFn from '../shared/isCustomComponent';
|
||||
import omittedCloseTags from '../shared/omittedCloseTags';
|
||||
import warnValidStyle from '../shared/warnValidStyle';
|
||||
import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook';
|
||||
@@ -361,6 +361,8 @@ function createOpenTagMarkup(
|
||||
): string {
|
||||
let ret = '<' + tagVerbatim;
|
||||
|
||||
const isCustomComponent = isCustomComponentFn(tagLowercase, props);
|
||||
|
||||
for (const propKey in props) {
|
||||
if (!hasOwnProperty.call(props, propKey)) {
|
||||
continue;
|
||||
@@ -376,7 +378,7 @@ function createOpenTagMarkup(
|
||||
propValue = createMarkupForStyles(propValue);
|
||||
}
|
||||
let markup = null;
|
||||
if (isCustomComponent(tagLowercase, props)) {
|
||||
if (isCustomComponent) {
|
||||
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
||||
markup = createMarkupForCustomAttribute(propKey, propValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user