Format logElementToConsole() slightly
Brian Vaughn committed
Apr 9, 2019 at 18:13 UTC
6d222080ad3acbbf43c0484adef0fc7a99238b18
1 file changed
+5
-4
src/backend/renderer.js
+5
-4
@@ -1570,11 +1570,12 @@ export function attach(
1570
}
1571
1572
const supportsGroup = typeof console.groupCollapsed === 'function';
1573
- const label =
1574
- '[Click to expand] <' + (result.displayName || 'Component') + ' />';
1575
-
1573
if (supportsGroup) {
1577
- console.groupCollapsed(label);
1574
+ console.groupCollapsed(
1575
+ `[Click to expand] %c<${result.displayName || 'Component'} />`,
1576
+ // --dom-tag-name-color is the CSS variable Chrome styles HTML elements with in the console.
1577
+ 'color: var(--dom-tag-name-color); font-weight: normal;'
1578
+ );
1579
}
1580
if (result.props !== null) {
1581
console.log('Props:', result.props);