summaryrefslogtreecommitdiff
path: root/packages/renderers/renderer-preact/server.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@matthewphillips.info> 2021-06-14 13:24:37 -0400
committerGravatar GitHub <noreply@github.com> 2021-06-14 13:24:37 -0400
commitaf03c90c2b21690106b3f1d3decc2153d1c6068f (patch)
treea65ea405f8e6c8f2c6cfc2729f890a7facd06428 /packages/renderers/renderer-preact/server.js
parent5602aabfe084a65e8b8c376c192ef34e4afd61ba (diff)
downloadastro-af03c90c2b21690106b3f1d3decc2153d1c6068f.tar.gz
astro-af03c90c2b21690106b3f1d3decc2153d1c6068f.tar.zst
astro-af03c90c2b21690106b3f1d3decc2153d1c6068f.zip
Fix usage of arrow functions as components (#426)
* Fix usage of arrow functions as components This fixes the React and Preact component as arrow function use-case by checking for the prototype property (arrow functions don't) * Check the prototype
Diffstat (limited to 'packages/renderers/renderer-preact/server.js')
-rw-r--r--packages/renderers/renderer-preact/server.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/renderers/renderer-preact/server.js b/packages/renderers/renderer-preact/server.js
index a46bb39b2..8465dbe69 100644
--- a/packages/renderers/renderer-preact/server.js
+++ b/packages/renderers/renderer-preact/server.js
@@ -5,7 +5,7 @@ import StaticHtml from './static-html.js';
function check(Component, props, children) {
if (typeof Component !== 'function') return false;
- if (typeof Component.prototype.render === 'function') {
+ if (Component.prototype != null && typeof Component.prototype.render === 'function') {
return BaseComponent.isPrototypeOf(Component);
}