astro/packages/integrations/react/client-v17.js
2022-04-02 14:15:41 -06:00

15 lines
409 B
JavaScript

import { createElement } from 'react';
import { hydrate } from 'react-dom';
import StaticHtml from './static-html.js';
export default (element) => (Component, props, children) =>
hydrate(
createElement(
Component,
{ ...props, suppressHydrationWarning: true },
children != null
? createElement(StaticHtml, { value: children, suppressHydrationWarning: true })
: children
),
element
);