Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenybai committed Jun 19, 2021
1 parent 092a151 commit 3e7a838
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/__test__/createElement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { OLD_VNODE_FIELD } from '../constants';
import { m } from '../m';
import { VNode, VProps } from '../structs';

const createManual = (tag: string, props: unknown) => Object.assign(document.createElement(tag), props);
const createManual = (tag: string, props: unknown) =>
Object.assign(document.createElement(tag), props);

const h = (tag: string, props?: VProps, ...children: VNode[]) =>
m(
Expand Down
7 changes: 4 additions & 3 deletions src/createElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ export const createElement = (vnode: VNode, attachField = true): HTMLElement | T
if (typeof vnode === 'string') return document.createTextNode(vnode);
const el = Object.assign(document.createElement(vnode.tag), vnode.props);

vnode.children && vnode.children.forEach(child => {
el.appendChild(createElement(child));
});
vnode.children &&
vnode.children.forEach((child) => {
el.appendChild(createElement(child));
});

if (attachField) el[OLD_VNODE_FIELD] = vnode;

Expand Down

0 comments on commit 3e7a838

Please sign in to comment.