Skip to content

Commit

Permalink
fix: inline components with props
Browse files Browse the repository at this point in the history
  • Loading branch information
thejackshelton committed Jan 25, 2025
1 parent 0013b58 commit 9b2a663
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions libs/qwikdev-astro/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type RendererContext = {
*
* We currently identify them through the jsx transform function call.
*
* In Qwik v1, the identifiers are _jsxq and _jsxc
* In Qwik v1, the identifiers are _jsxQ - _jsxC - _jsxS
*
* In Qwik v2, it is jsxsplit and I believe jsxSorted
*
Expand All @@ -30,12 +30,8 @@ function isInlineComponent(component: unknown): boolean {
return false;
}
const codeStr = component?.toString().toLowerCase();
return (
(codeStr.includes("_jsxq") ||
codeStr.includes("_jsxc") ||
codeStr.includes("jsxsplit")) &&
component.name !== "QwikComponent"
);
const qwikJsxIdentifiers = ["_jsxq", "_jsxc", "_jsxs", "jsxsplit"];
return qwikJsxIdentifiers.some(id => codeStr.includes(id)) && component.name !== "QwikComponent";
}

function isQwikComponent(component: unknown) {
Expand Down

0 comments on commit 9b2a663

Please sign in to comment.