[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 StaticHtml from './static-html.js';
|
||||
|
||||
export default (element) => (Component, props, children, { client }) =>
|
||||
{
|
||||
export default (element) =>
|
||||
(Component, props, children, { client }) => {
|
||||
const componentEl = createElement(
|
||||
Component,
|
||||
props,
|
||||
children != null
|
||||
? createElement(StaticHtml, { value: children })
|
||||
: children
|
||||
children != null ? createElement(StaticHtml, { value: children }) : children
|
||||
);
|
||||
if (client === 'only') {
|
||||
return render(componentEl, element);
|
||||
|
|
|
@ -2,14 +2,12 @@ import { createElement } from 'react';
|
|||
import { createRoot, hydrateRoot } from 'react-dom/client';
|
||||
import StaticHtml from './static-html.js';
|
||||
|
||||
export default (element) => (Component, props, children, { client }) =>
|
||||
{
|
||||
export default (element) =>
|
||||
(Component, props, children, { client }) => {
|
||||
const componentEl = createElement(
|
||||
Component,
|
||||
props,
|
||||
children != null
|
||||
? createElement(StaticHtml, { value: children })
|
||||
: children
|
||||
children != null ? createElement(StaticHtml, { value: children }) : children
|
||||
);
|
||||
if (client === 'only') {
|
||||
return createRoot(element).render(componentEl);
|
||||
|
|
Loading…
Reference in a new issue