astro/packages/integrations/react/client.js

16 lines
424 B
JavaScript
Raw Normal View History

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