[ci] format
This commit is contained in:
parent
678c2b7523
commit
8666f22a0f
2 changed files with 6 additions and 10 deletions
|
@ -2,14 +2,12 @@ import { createElement } from 'react';
|
||||||
import { render, hydrate } from 'react-dom';
|
import { render, hydrate } from 'react-dom';
|
||||||
import StaticHtml from './static-html.js';
|
import StaticHtml from './static-html.js';
|
||||||
|
|
||||||
export default (element) => (Component, props, children, { client }) =>
|
export default (element) =>
|
||||||
{
|
(Component, props, children, { client }) => {
|
||||||
const componentEl = createElement(
|
const componentEl = createElement(
|
||||||
Component,
|
Component,
|
||||||
props,
|
props,
|
||||||
children != null
|
children != null ? createElement(StaticHtml, { value: children }) : children
|
||||||
? createElement(StaticHtml, { value: children })
|
|
||||||
: children
|
|
||||||
);
|
);
|
||||||
if (client === 'only') {
|
if (client === 'only') {
|
||||||
return render(componentEl, element);
|
return render(componentEl, element);
|
||||||
|
|
|
@ -2,14 +2,12 @@ import { createElement } from 'react';
|
||||||
import { createRoot, hydrateRoot } from 'react-dom/client';
|
import { createRoot, hydrateRoot } from 'react-dom/client';
|
||||||
import StaticHtml from './static-html.js';
|
import StaticHtml from './static-html.js';
|
||||||
|
|
||||||
export default (element) => (Component, props, children, { client }) =>
|
export default (element) =>
|
||||||
{
|
(Component, props, children, { client }) => {
|
||||||
const componentEl = createElement(
|
const componentEl = createElement(
|
||||||
Component,
|
Component,
|
||||||
props,
|
props,
|
||||||
children != null
|
children != null ? createElement(StaticHtml, { value: children }) : children
|
||||||
? createElement(StaticHtml, { value: children })
|
|
||||||
: children
|
|
||||||
);
|
);
|
||||||
if (client === 'only') {
|
if (client === 'only') {
|
||||||
return createRoot(element).render(componentEl);
|
return createRoot(element).render(componentEl);
|
||||||
|
|
Loading…
Reference in a new issue