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

Function isCustomComponent

code/higher-order-components/public/app.js:15152–15173  ·  view source on GitHub ↗
(tagName, props)

Source from the content-addressed store, hash-verified

15150}
15151
15152function isCustomComponent(tagName, props) {
15153 if (tagName.indexOf('-') === -1) {
15154 return typeof props.is === 'string';
15155 }
15156 switch (tagName) {
15157 // These are reserved SVG and MathML elements.
15158 // We don't mind this whitelist too much because we expect it to never grow.
15159 // The alternative is to track the namespace in a few places which is convoluted.
15160 // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
15161 case 'annotation-xml':
15162 case 'color-profile':
15163 case 'font-face':
15164 case 'font-face-src':
15165 case 'font-face-uri':
15166 case 'font-face-format':
15167 case 'font-face-name':
15168 case 'missing-glyph':
15169 return false;
15170 default:
15171 return true;
15172 }
15173}
15174
15175// When adding attributes to the HTML or SVG whitelist, be sure to
15176// 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