summaryrefslogtreecommitdiff
path: root/packages/renderers/renderer-react/client.js
blob: aa29d1ba99f797e50fe5af589b25063016e48533 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
  );