MCPcopy Create free account
hub / github.com/reactjs/react-rails / isCustomComponent

Function isCustomComponent

lib/assets/react-source/development/react.js:8460–8483  ·  view source on GitHub ↗
(tagName, props)

Source from the content-addressed store, hash-verified

8458 }
8459
8460 function isCustomComponent(tagName, props) {
8461 if (tagName.indexOf('-') === -1) {
8462 return typeof props.is === 'string';
8463 }
8464
8465 switch (tagName) {
8466 // These are reserved SVG and MathML elements.
8467 // We don't mind this whitelist too much because we expect it to never grow.
8468 // The alternative is to track the namespace in a few places which is convoluted.
8469 // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
8470 case 'annotation-xml':
8471 case 'color-profile':
8472 case 'font-face':
8473 case 'font-face-src':
8474 case 'font-face-uri':
8475 case 'font-face-format':
8476 case 'font-face-name':
8477 case 'missing-glyph':
8478 return false;
8479
8480 default:
8481 return true;
8482 }
8483 }
8484
8485 // When adding attributes to the HTML or SVG whitelist, be sure to
8486 // also add them to this module to ensure casing and incorrect name

Callers 6

validatePropertiesFunction · 0.70
validateProperties$2Function · 0.70
createElementFunction · 0.70
setInitialPropertiesFunction · 0.70
updatePropertiesFunction · 0.70
diffHydratedPropertiesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected