import { h } from 'preact'; type Props = { value: string; name?: string; hydrate?: boolean; }; /** * 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 Preact that this subtree is * entirely static and will never change via `shouldComponentUpdate`. */ const StaticHtml = ({ value, name, hydrate = true }: Props) => { if (!value) return null; const tagName = hydrate ? 'astro-slot' : 'astro-static-slot'; return h(tagName, { name, dangerouslySetInnerHTML: { __html: value } }); }; /** * This tells Preact 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; tem-store'>ansg191/system-store Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/solid-dom-fixtures/conditionalExpressions/code.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-10-17Add JSC.WeakGravatar Jarred Sumner 2-0/+293
2023-10-15more microtasksGravatar Jarred Sumner 1-11/+5
2023-10-15It's starting to workGravatar Jarred Sumner 6-49/+89
2023-10-15Things can happenGravatar Jarred Sumner 9-53/+150
2023-10-15FurtherGravatar Jarred Sumner 1-20/+30
2023-10-15The startup message sends successfullyGravatar Jarred Sumner 4-96/+130
2023-10-15it compiledGravatar Jarred Sumner 2-158/+238
2023-10-15okay we are starting to try itGravatar Jarred Sumner 4-9/+43
2023-10-15Okay most of the code is writtenGravatar Jarred Sumner 3-29/+398
2023-10-14MoreGravatar Jarred Sumner 7-66/+504
2023-10-14wipGravatar Jarred Sumner 8-16/+1194
2023-10-14More progressGravatar Jarred Sumner 4-36/+405
2023-10-13wipGravatar Jarred Sumner 8-48/+308