ac3e870280
* fix: renderer behavior with no children * [ci] Prettier fix * Force CI * fix: properly handle falsy values * [ci] Prettier fix * chore: force ci * [experiment] netlify ignore Co-authored-by: GitHub Action <github-action@users.noreply.github.com>
13 lines
418 B
JavaScript
13 lines
418 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
|
|
);
|