From 18449c818d5a4a2c7633a045e4912244f5e69d78 Mon Sep 17 00:00:00 2001 From: apatel369 Date: Sat, 30 Nov 2024 14:53:48 -0600 Subject: [PATCH] update condition --- packages/astro/src/jsx/rehype.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/astro/src/jsx/rehype.ts b/packages/astro/src/jsx/rehype.ts index d04bf0d782..d124c9a9f7 100644 --- a/packages/astro/src/jsx/rehype.ts +++ b/packages/astro/src/jsx/rehype.ts @@ -30,7 +30,13 @@ export const rehypeAnalyzeAstroMetadata: RehypePlugin = () => { if (node.type !== 'mdxJsxFlowElement' && node.type !== 'mdxJsxTextElement') return; const tagName = node.name; - if (!tagName || !isComponent(tagName)) return; + if ( + !tagName || + !isComponent(tagName) || + !hasClientDirective(node) || + !hasServerDeferDirective(node) + ) + return; // From this point onwards, `node` is confirmed to be an island component