mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
15 lines
424 B
JavaScript
15 lines
424 B
JavaScript
import { createElement } from 'react';
|
|
import { hydrateRoot } from 'react-dom/client';
|
|
import StaticHtml from './static-html.js';
|
|
|
|
export default (element) => (Component, props, children) =>
|
|
hydrateRoot(
|
|
element,
|
|
createElement(
|
|
Component,
|
|
{ ...props, suppressHydrationWarning: true },
|
|
children != null
|
|
? createElement(StaticHtml, { value: children, suppressHydrationWarning: true })
|
|
: children
|
|
)
|
|
);
|