( target: Array<Chunk | PrecomputedChunk>, props: Object, tag: string, formatContext: FormatContext, )
| 3461 | } |
| 3462 | |
| 3463 | function 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 | |
| 3497 | function pushStartMenuItem( |
| 3498 | target: Array<Chunk | PrecomputedChunk>, |
no test coverage detected