[ci] format

This commit is contained in:
matthewp 2022-05-12 16:06:40 +00:00 committed by github-actions[bot]
parent 678c2b7523
commit 8666f22a0f
2 changed files with 6 additions and 10 deletions

View file

@ -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);

View file

@ -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);