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

Function isCustomComponent

code/new-context-api/public/app.js:14519–14540  ·  view source on GitHub ↗
(tagName, props)

Source from the content-addressed store, hash-verified

14517}
14518
14519function isCustomComponent(tagName, props) {
14520 if (tagName.indexOf('-') === -1) {
14521 return typeof props.is === 'string';
14522 }
14523 switch (tagName) {
14524 // These are reserved SVG and MathML elements.
14525 // We don't mind this whitelist too much because we expect it to never grow.
14526 // The alternative is to track the namespace in a few places which is convoluted.
14527 // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
14528 case 'annotation-xml':
14529 case 'color-profile':
14530 case 'font-face':
14531 case 'font-face-src':
14532 case 'font-face-uri':
14533 case 'font-face-format':
14534 case 'font-face-name':
14535 case 'missing-glyph':
14536 return false;
14537 default:
14538 return true;
14539 }
14540}
14541
14542// When adding attributes to the HTML or SVG whitelist, be sure to
14543// 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