astro/packages/integrations/react/client-v17.js

16 lines
409 B
JavaScript
Raw Normal View History

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 },
2022-04-02 20:15:41 +00:00
children != null
? createElement(StaticHtml, { value: children, suppressHydrationWarning: true })
: children
),
element
);