Skip to content

Commit

Permalink
feat: add default value for h
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Jul 14, 2022
1 parent 5cf732b commit db279c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/runtime-core/__tests__/rendererElement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("renderer: element", () => {
});

it("should create an element", () => {
render(h("div", null, []), root);
render(h("div"), root);
expect(inner(root)).toBe("<div></div>");
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/h.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createVNode } from "./vnode";
export const h = (type: string, props: any, children: string | Array<any>) => {
export const h = (type: string, props: any = null, children: string | Array<any> = []) => {
return createVNode(type, props, children);
};

0 comments on commit db279c0

Please sign in to comment.