aboutsummaryrefslogtreecommitdiff
path: root/packages/renderers/renderer-react/static-html.js
diff options
context:
space:
mode:
authorGravatar Fred K. Schott <fkschott@gmail.com> 2022-04-11 11:19:41 -0700
committerGravatar GitHub <noreply@github.com> 2022-04-11 11:19:41 -0700
commit771127ea294fb297c080b2bb3e74b433043b90f4 (patch)
treed0c80721164a81592e328d22d4ecb9af932c727f /packages/renderers/renderer-react/static-html.js
parent6c6e9477402e9d30659f56488b1027f7179cd43b (diff)
downloadastro-771127ea294fb297c080b2bb3e74b433043b90f4.tar.gz
astro-771127ea294fb297c080b2bb3e74b433043b90f4.tar.zst
astro-771127ea294fb297c080b2bb3e74b433043b90f4.zip
remove unused renderers (#3063)
Diffstat (limited to 'packages/renderers/renderer-react/static-html.js')
-rw-r--r--packages/renderers/renderer-react/static-html.js27
1 files changed, 0 insertions, 27 deletions
diff --git a/packages/renderers/renderer-react/static-html.js b/packages/renderers/renderer-react/static-html.js
deleted file mode 100644
index ecd76ae9b..000000000
--- a/packages/renderers/renderer-react/static-html.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import { createElement as h } from 'react';
-
-/**
- * Astro passes `children` as a string of HTML, so we need
- * a wrapper `div` to render that content as VNodes.
- *
- * As a bonus, we can signal to React that this subtree is
- * entirely static and will never change via `shouldComponentUpdate`.
- */
-const StaticHtml = ({ value }) => {
- if (!value) return null;
- return h('astro-fragment', {
- suppressHydrationWarning: true,
- dangerouslySetInnerHTML: { __html: value },
- });
-};
-
-/**
- * This tells React to opt-out of re-rendering this subtree,
- * In addition to being a performance optimization,
- * this also allows other frameworks to attach to `children`.
- *
- * See https://preactjs.com/guide/v8/external-dom-mutations
- */
-StaticHtml.shouldComponentUpdate = () => false;
-
-export default StaticHtml;