diff options
author | 2023-12-05 04:14:04 -0800 | |
---|---|---|
committer | 2023-12-05 07:14:04 -0500 | |
commit | 30982078e666f54429fa7b6e0014c505512af024 (patch) | |
tree | 934fe1c10b93a69e210955ad74e60cb68a19ac54 | |
parent | 466d1f0ab200a4a89ae1617bb8ebfa4eeabdac23 (diff) | |
download | astro-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.ts | 12 |
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>`, |