summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Fred K. Schott <fkschott@gmail.com> 2023-12-05 04:14:04 -0800
committerGravatar GitHub <noreply@github.com> 2023-12-05 07:14:04 -0500
commit30982078e666f54429fa7b6e0014c505512af024 (patch)
tree934fe1c10b93a69e210955ad74e60cb68a19ac54
parent466d1f0ab200a4a89ae1617bb8ebfa4eeabdac23 (diff)
downloadastro-30982078e666f54429fa7b6e0014c505512af024.tar.gz
astro-30982078e666f54429fa7b6e0014c505512af024.tar.zst
astro-30982078e666f54429fa7b6e0014c505512af024.zip
filter out internal island props (#9304)
-rw-r--r--packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts b/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts
index 1c9a9c404..edc038df7 100644
--- a/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts
+++ b/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts
@@ -153,14 +153,16 @@ export default {
});
}
- // Add the props if we have any
- if (Object.keys(islandProps).length > 0) {
+ // Display the props if we have any
+ // Ignore the "data-astro-cid-XXXXXX" prop (internal)
+ const islandPropsEntries = Object.entries(islandProps).filter(
+ (prop: any) => !prop[0].startsWith('data-astro-cid-')
+ );
+ if (islandPropsEntries.length > 0) {
tooltip.sections.push({
title: 'Props',
content: `<pre><code>${JSON.stringify(
- Object.fromEntries(
- Object.entries(islandProps).map((prop: any) => [prop[0], prop[1][1]])
- ),
+ Object.fromEntries(islandPropsEntries.map((prop: any) => [prop[0], prop[1][1]])),
undefined,
2
)}</code></pre>`,