1503
}
1504
}
1505
1506
+function pushStartAnchor(
1507
+ target: Array<Chunk | PrecomputedChunk>,
1508
+ props: Object,
1509
+): ReactNodeList {
1510
+ target.push(startChunkForTag('a'));
1511
+
1512
+ let children = null;
1513
+ let innerHTML = null;
1514
+ for (const propKey in props) {
1515
+ if (hasOwnProperty.call(props, propKey)) {
1516
+ const propValue = props[propKey];
1517
+ if (propValue == null) {
1518
+ continue;
1519
+ }
1520
+ switch (propKey) {
1521
+ case 'children':
1522
+ children = propValue;
1523
+ break;
1524
+ case 'dangerouslySetInnerHTML':
1525
+ innerHTML = propValue;
1526
+ break;
1527
+ case 'href':
1528
+ if (propValue === '') {
1529
+ // Empty `href` is special on anchors so we're short-circuiting here.
1530
+ // On other tags it should trigger a warning
1531
+ pushStringAttribute(target, 'href', '');
1532
+ } else {
1533
+ pushAttribute(target, propKey, propValue);
1534
+ }
1535
+ break;
1536
+ default:
1537
+ pushAttribute(target, propKey, propValue);
1538
+ break;
1539
+ }
1540
+ }
1541
+ }
1542
+
1543
+ target.push(endOfStartTag);
1544
+ pushInnerHTML(target, innerHTML, children);
1545
+ if (typeof children === 'string') {
1546
+ // Special case children as a string to avoid the unnecessary comment.
1547
+ // TODO: Remove this special case after the general optimization is in place.
1548
+ target.push(stringToChunk(encodeHTMLTextNode(children)));
1549
+ return null;
1550
+ }
1551
+ return children;
1552
+}
1553
+
1554
function pushStartSelect(
1555
target: Array<Chunk | PrecomputedChunk>,
1556
props: Object,
3583
case 'span':
3584
case 'svg':
3585
case 'path':
3586
+ // Fast track very common tags
3587
+ break;
3588
case 'a':
3589
+ if (enableFilterEmptyStringAttributesDOM) {
3590
+ return pushStartAnchor(target, props);
3591
+ } else {
3592
+ break;
3593
+ }
3594
case 'g':
3595
case 'p':
3596
case 'li':