diff --git a/packages/react-dom-bindings/src/client/ReactDOMComponent.js b/packages/react-dom-bindings/src/client/ReactDOMComponent.js index 070baf4bbd1a5..9a1b0894dd982 100644 --- a/packages/react-dom-bindings/src/client/ReactDOMComponent.js +++ b/packages/react-dom-bindings/src/client/ReactDOMComponent.js @@ -58,7 +58,7 @@ import { } from './CSSPropertyOperations'; import {HTML_NAMESPACE, getIntrinsicNamespace} from './DOMNamespaces'; import {getPropertyInfo} from '../shared/DOMProperty'; -import isCustomComponent from '../shared/isCustomComponent'; +import isCustomElement from '../shared/isCustomElement'; import possibleStandardNames from '../shared/possibleStandardNames'; import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook'; import {validateProperties as validateInputProperties} from '../shared/ReactDOMNullInputValuePropHook'; @@ -264,7 +264,7 @@ function setProp( tag: string, key: string, value: mixed, - isCustomComponentTag: boolean, + isCustomElementTag: boolean, props: any, ): void { switch (key) { @@ -390,7 +390,7 @@ function setProp( warnForInvalidEventListener(key, value); } } else { - if (isCustomComponentTag) { + if (isCustomElementTag) { if (enableCustomElementPropertySupport) { setValueForPropertyOnCustomComponent(domElement, key, value); } else { @@ -653,7 +653,7 @@ export function setInitialProperties( } // defaultChecked and defaultValue are ignored by setProp default: { - // TODO: If the `is` prop is specified, this should go through the isCustomComponentTag flow. + // TODO: If the `is` prop is specified, this should go through the isCustomElementTag flow. setProp(domElement, tag, propKey, propValue, false, props); } } @@ -662,8 +662,8 @@ export function setInitialProperties( } } - const isCustomComponentTag = - enableCustomElementPropertySupport && isCustomComponent(tag, props); + const isCustomElementTag = + enableCustomElementPropertySupport && isCustomElement(tag, props); for (const propKey in props) { if (!props.hasOwnProperty(propKey)) { continue; @@ -672,7 +672,7 @@ export function setInitialProperties( if (propValue == null) { continue; } - setProp(domElement, tag, propKey, propValue, isCustomComponentTag, props); + setProp(domElement, tag, propKey, propValue, isCustomElementTag, props); } } @@ -949,7 +949,7 @@ export function updateProperties( } // defaultChecked and defaultValue are ignored by setProp default: { - // TODO: If the `is` prop is specified, this should go through the isCustomComponentTag flow. + // TODO: If the `is` prop is specified, this should go through the isCustomElementTag flow. setProp(domElement, tag, propKey, propValue, false, nextProps); } } @@ -958,20 +958,13 @@ export function updateProperties( } } - const isCustomComponentTag = - enableCustomElementPropertySupport && isCustomComponent(tag, nextProps); + const isCustomElementTag = + enableCustomElementPropertySupport && isCustomElement(tag, nextProps); // Apply the diff. for (let i = 0; i < updatePayload.length; i += 2) { const propKey = updatePayload[i]; const propValue = updatePayload[i + 1]; - setProp( - domElement, - tag, - propKey, - propValue, - isCustomComponentTag, - nextProps, - ); + setProp(domElement, tag, propKey, propValue, isCustomElementTag, nextProps); } } @@ -1357,7 +1350,7 @@ export function diffHydratedProperties( extraAttributeNames.add(attributes[i].name); } } - if (isCustomComponent(tag, props)) { + if (isCustomElement(tag, props)) { diffHydratedCustomComponent( domElement, tag, diff --git a/packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js b/packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js index 92e36b9171515..baa33f1a7c5c6 100644 --- a/packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js +++ b/packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js @@ -35,7 +35,7 @@ import { processDispatchQueue, accumulateTwoPhaseListeners, } from '../DOMPluginEventSystem'; -import isCustomComponent from '../../shared/isCustomComponent'; +import isCustomElement from '../../shared/isCustomElement'; function registerEvents() { registerTwoPhaseEvent('onChange', [ @@ -312,7 +312,7 @@ function extractEvents( } else if ( enableCustomElementPropertySupport && targetInst && - isCustomComponent(targetInst.elementType, targetInst.memoizedProps) + isCustomElement(targetInst.elementType, targetInst.memoizedProps) ) { getTargetInstFunc = getTargetInstForChangeEvent; } diff --git a/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js index ca469bc792690..64dc7126ad6d4 100644 --- a/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js @@ -7,7 +7,7 @@ import {BOOLEAN, getPropertyInfo} from './DOMProperty'; import {ATTRIBUTE_NAME_CHAR} from './isAttributeNameSafe'; -import isCustomComponent from './isCustomComponent'; +import isCustomElement from './isCustomElement'; import possibleStandardNames from './possibleStandardNames'; import hasOwnProperty from 'shared/hasOwnProperty'; import {enableCustomElementPropertySupport} from 'shared/ReactFeatureFlags'; @@ -308,7 +308,7 @@ function warnUnknownProperties(type, props, eventRegistry) { } export function validateProperties(type, props, eventRegistry) { - if (isCustomComponent(type, props)) { + if (isCustomElement(type, props)) { return; } warnUnknownProperties(type, props, eventRegistry); diff --git a/packages/react-dom-bindings/src/shared/isCustomComponent.js b/packages/react-dom-bindings/src/shared/isCustomElement.js similarity index 89% rename from packages/react-dom-bindings/src/shared/isCustomComponent.js rename to packages/react-dom-bindings/src/shared/isCustomElement.js index 9ea9ead2a2f0f..f3e03e000030c 100644 --- a/packages/react-dom-bindings/src/shared/isCustomComponent.js +++ b/packages/react-dom-bindings/src/shared/isCustomElement.js @@ -7,7 +7,7 @@ * @flow */ -function isCustomComponent(tagName: string, props: Object): boolean { +function isCustomElement(tagName: string, props: Object): boolean { if (tagName.indexOf('-') === -1) { return typeof props.is === 'string'; } @@ -30,4 +30,4 @@ function isCustomComponent(tagName: string, props: Object): boolean { } } -export default isCustomComponent; +export default isCustomElement;