Skip to content

Commit a09a9ca

Browse files
committed
Rename isCustomComponent to isCustomElement
That's the technical term.
1 parent c25c735 commit a09a9ca

File tree

4 files changed

+16
-23
lines changed

4 files changed

+16
-23
lines changed

packages/react-dom-bindings/src/client/ReactDOMComponent.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import {
5858
} from './CSSPropertyOperations';
5959
import {HTML_NAMESPACE, getIntrinsicNamespace} from './DOMNamespaces';
6060
import {getPropertyInfo} from '../shared/DOMProperty';
61-
import isCustomComponent from '../shared/isCustomComponent';
61+
import isCustomElement from '../shared/isCustomElement';
6262
import possibleStandardNames from '../shared/possibleStandardNames';
6363
import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook';
6464
import {validateProperties as validateInputProperties} from '../shared/ReactDOMNullInputValuePropHook';
@@ -264,7 +264,7 @@ function setProp(
264264
tag: string,
265265
key: string,
266266
value: mixed,
267-
isCustomComponentTag: boolean,
267+
isCustomElementTag: boolean,
268268
props: any,
269269
): void {
270270
switch (key) {
@@ -390,7 +390,7 @@ function setProp(
390390
warnForInvalidEventListener(key, value);
391391
}
392392
} else {
393-
if (isCustomComponentTag) {
393+
if (isCustomElementTag) {
394394
if (enableCustomElementPropertySupport) {
395395
setValueForPropertyOnCustomComponent(domElement, key, value);
396396
} else {
@@ -657,7 +657,7 @@ export function setInitialProperties(
657657
}
658658
// defaultChecked and defaultValue are ignored by setProp
659659
default: {
660-
// TODO: If the `is` prop is specified, this should go through the isCustomComponentTag flow.
660+
// TODO: If the `is` prop is specified, this should go through the isCustomElementTag flow.
661661
setProp(domElement, tag, propKey, propValue, false, props);
662662
}
663663
}
@@ -666,7 +666,7 @@ export function setInitialProperties(
666666
}
667667
}
668668

669-
const isCustomComponentTag = isCustomComponent(tag, props);
669+
const isCustomElementTag = isCustomElement(tag, props);
670670
for (const propKey in props) {
671671
if (!props.hasOwnProperty(propKey)) {
672672
continue;
@@ -675,7 +675,7 @@ export function setInitialProperties(
675675
if (propValue == null) {
676676
continue;
677677
}
678-
setProp(domElement, tag, propKey, propValue, isCustomComponentTag, props);
678+
setProp(domElement, tag, propKey, propValue, isCustomElementTag, props);
679679
}
680680
}
681681

@@ -952,7 +952,7 @@ export function updateProperties(
952952
}
953953
// defaultChecked and defaultValue are ignored by setProp
954954
default: {
955-
// TODO: If the `is` prop is specified, this should go through the isCustomComponentTag flow.
955+
// TODO: If the `is` prop is specified, this should go through the isCustomElementTag flow.
956956
setProp(domElement, tag, propKey, propValue, false, nextProps);
957957
}
958958
}
@@ -961,19 +961,12 @@ export function updateProperties(
961961
}
962962
}
963963

964-
const isCustomComponentTag = isCustomComponent(tag, nextProps);
964+
const isCustomElementTag = isCustomElement(tag, nextProps);
965965
// Apply the diff.
966966
for (let i = 0; i < updatePayload.length; i += 2) {
967967
const propKey = updatePayload[i];
968968
const propValue = updatePayload[i + 1];
969-
setProp(
970-
domElement,
971-
tag,
972-
propKey,
973-
propValue,
974-
isCustomComponentTag,
975-
nextProps,
976-
);
969+
setProp(domElement, tag, propKey, propValue, isCustomElementTag, nextProps);
977970
}
978971
}
979972

@@ -1359,7 +1352,7 @@ export function diffHydratedProperties(
13591352
extraAttributeNames.add(attributes[i].name);
13601353
}
13611354
}
1362-
if (isCustomComponent(tag, props)) {
1355+
if (isCustomElement(tag, props)) {
13631356
diffHydratedCustomComponent(
13641357
domElement,
13651358
tag,

packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
processDispatchQueue,
3636
accumulateTwoPhaseListeners,
3737
} from '../DOMPluginEventSystem';
38-
import isCustomComponent from '../../shared/isCustomComponent';
38+
import isCustomElement from '../../shared/isCustomElement';
3939

4040
function registerEvents() {
4141
registerTwoPhaseEvent('onChange', [
@@ -312,7 +312,7 @@ function extractEvents(
312312
} else if (
313313
enableCustomElementPropertySupport &&
314314
targetInst &&
315-
isCustomComponent(targetInst.elementType, targetInst.memoizedProps)
315+
isCustomElement(targetInst.elementType, targetInst.memoizedProps)
316316
) {
317317
getTargetInstFunc = getTargetInstForChangeEvent;
318318
}

packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import {BOOLEAN, getPropertyInfo} from './DOMProperty';
99
import {ATTRIBUTE_NAME_CHAR} from './isAttributeNameSafe';
10-
import isCustomComponent from './isCustomComponent';
10+
import isCustomElement from './isCustomElement';
1111
import possibleStandardNames from './possibleStandardNames';
1212
import hasOwnProperty from 'shared/hasOwnProperty';
1313
import {enableCustomElementPropertySupport} from 'shared/ReactFeatureFlags';
@@ -308,7 +308,7 @@ function warnUnknownProperties(type, props, eventRegistry) {
308308
}
309309

310310
export function validateProperties(type, props, eventRegistry) {
311-
if (isCustomComponent(type, props)) {
311+
if (isCustomElement(type, props)) {
312312
return;
313313
}
314314
warnUnknownProperties(type, props, eventRegistry);

packages/react-dom-bindings/src/shared/isCustomComponent.js renamed to packages/react-dom-bindings/src/shared/isCustomElement.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @flow
88
*/
99

10-
function isCustomComponent(tagName: string, props: Object): boolean {
10+
function isCustomElement(tagName: string, props: Object): boolean {
1111
if (tagName.indexOf('-') === -1) {
1212
return typeof props.is === 'string';
1313
}
@@ -30,4 +30,4 @@ function isCustomComponent(tagName: string, props: Object): boolean {
3030
}
3131
}
3232

33-
export default isCustomComponent;
33+
export default isCustomElement;

0 commit comments

Comments
 (0)