MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / isCustomComponent

Function isCustomComponent

code/event-handlers/public/app.js:14488–14509  ·  view source on GitHub ↗
(tagName, props)

Source from the content-addressed store, hash-verified

14486}
14487
14488function isCustomComponent(tagName, props) {
14489 if (tagName.indexOf('-') === -1) {
14490 return typeof props.is === 'string';
14491 }
14492 switch (tagName) {
14493 // These are reserved SVG and MathML elements.
14494 // We don't mind this whitelist too much because we expect it to never grow.
14495 // The alternative is to track the namespace in a few places which is convoluted.
14496 // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
14497 case 'annotation-xml':
14498 case 'color-profile':
14499 case 'font-face':
14500 case 'font-face-src':
14501 case 'font-face-uri':
14502 case 'font-face-format':
14503 case 'font-face-name':
14504 case 'missing-glyph':
14505 return false;
14506 default:
14507 return true;
14508 }
14509}
14510
14511// When adding attributes to the HTML or SVG whitelist, be sure to
14512// also add them to this module to ensure casing and incorrect name

Callers 6

validatePropertiesFunction · 0.70
validateProperties$2Function · 0.70
createElement$1Function · 0.70
setInitialProperties$1Function · 0.70
updateProperties$1Function · 0.70
diffHydratedProperties$1Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected