MCPcopy Index your code
hub / github.com/react/react / pushSelfClosing

Function pushSelfClosing

packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js:3463–3495  ·  view source on GitHub ↗
(
  target: Array<Chunk | PrecomputedChunk>,
  props: Object,
  tag: string,
  formatContext: FormatContext,
)

Source from the content-addressed store, hash-verified

3461}
3462
3463function pushSelfClosing(
3464 target: Array<Chunk | PrecomputedChunk>,
3465 props: Object,
3466 tag: string,
3467 formatContext: FormatContext,
3468): null {
3469 target.push(startChunkForTag(tag));
3470
3471 for (const propKey in props) {
3472 if (hasOwnProperty.call(props, propKey)) {
3473 const propValue = props[propKey];
3474 if (propValue == null) {
3475 continue;
3476 }
3477 switch (propKey) {
3478 case 'children':
3479 case 'dangerouslySetInnerHTML':
3480 throw new Error(
3481 `${tag} is a self-closing tag and must neither have \`children\` nor ` +
3482 'use `dangerouslySetInnerHTML`.',
3483 );
3484 default:
3485 pushAttribute(target, propKey, propValue);
3486 break;
3487 }
3488 }
3489 }
3490
3491 pushViewTransitionAttributes(target, formatContext);
3492
3493 target.push(endOfStartTagSelfClosing);
3494 return null;
3495}
3496
3497function pushStartMenuItem(
3498 target: Array<Chunk | PrecomputedChunk>,

Callers 3

pushMetaFunction · 0.85
pushImgFunction · 0.85
pushStartInstanceFunction · 0.85

Calls 4

startChunkForTagFunction · 0.85
pushAttributeFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected