Skip to content

Commit 72b26da

Browse files
authored
Skip check for known Qwik components (#9482)
1 parent 97342d2 commit 72b26da

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

.changeset/eight-ears-call.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astrojs/preact': patch
3+
'@astrojs/react': patch
4+
'@astrojs/solid-js': patch
5+
---
6+
7+
Improves compatability with the [Qwik adapter](https://github.com/QwikDev/astro)

packages/integrations/preact/src/server.ts

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ let consoleFilterRefs = 0;
1313

1414
function check(this: RendererContext, Component: any, props: Record<string, any>, children: any) {
1515
if (typeof Component !== 'function') return false;
16+
if (Component.name === "QwikComponent") return false;
1617

1718
if (Component.prototype != null && typeof Component.prototype.render === 'function') {
1819
return BaseComponent.isPrototypeOf(Component);

packages/integrations/react/server-v17.js

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function check(Component, props, children) {
2020
return Component['$$typeof']?.toString().slice('Symbol('.length).startsWith('react');
2121
}
2222
if (typeof Component !== 'function') return false;
23+
if (Component.name === "QwikComponent") return false;
2324

2425
if (Component.prototype != null && typeof Component.prototype.render === 'function') {
2526
return React.Component.isPrototypeOf(Component) || React.PureComponent.isPrototypeOf(Component);

packages/integrations/react/server.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ async function check(Component, props, children) {
2222
return Component['$$typeof'].toString().slice('Symbol('.length).startsWith('react');
2323
}
2424
if (typeof Component !== 'function') return false;
25+
if (Component.name === "QwikComponent") return false;
2526

2627
// Preact forwarded-ref components can be functions, which React does not support
2728
if (typeof Component === 'function' && Component['$$typeof'] === Symbol.for('react.forward_ref'))

packages/integrations/solid/src/server.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const slotName = (str: string) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w
66

77
function check(this: RendererContext, Component: any, props: Record<string, any>, children: any) {
88
if (typeof Component !== 'function') return false;
9+
if (Component.name === "QwikComponent") return false;
910
const { html } = renderToStaticMarkup.call(this, Component, props, children);
1011
return typeof html === 'string';
1112
}

0 commit comments

Comments
 (0)