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, name, hydrate = true }) => { if (!value) return null; const tagName = hydrate ? 'astro-slot' : 'astro-static-slot'; return h(tagName, { name, 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; '>bun-crash-dump Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc/WebKit (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-06-22change the directory structurejarred/renameGravatar Jarred Sumner 1-0/+0
2022-06-22maybe improve CPP build timeGravatar Jarred Sumner 1-24/+37
2022-06-22Move builtins to src/javascript/jsc/builtinsGravatar Jarred Sumner 72-6/+2285
2022-06-22Tweak test runner outputGravatar Jarred Sumner 1-90/+44
2022-06-22Cleanup some testsGravatar Jarred Sumner 2-8/+46
2022-06-22Update Dockerfile.baseGravatar Jarred Sumner 1-1/+1
2022-06-22Update WebKitGravatar Jarred Sumner 1-0/+0
2022-06-22cleanup websocket testGravatar Jarred Sumner 1-3/+6
2022-06-22Fix `WebSocket` when HTTP server is not runningGravatar Jarred Sumner 14-38/+103
2022-06-22Update build-idGravatar Jarred Sumner 1-1/+1
2022-06-22cleanupGravatar Jarred Sumner 6-719/+3
2022-06-22Update index.d.tsGravatar Jarred Sumner 1-0/+1
2022-06-22types for `bun:jsc`Gravatar Jarred Sumner 2-1/+37
2022-06-22Slightly customize the `events` polyfill so it uses ESMGravatar Jarred Sumner 1-1/+522
2022-06-22Fix memory bugs in escapeHTML & arrayBufferToStringGravatar Jarred Sumner 1-65/+61