Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"@cycle/run": "^5.3.0",
"@types/mocha": "^5.2.7",
"@types/node": "^10.5.2",
"@types/react": "16.9.3",
"@types/react": "16.9.49",
"mocha": "^6.2.0",
"react": "16.9.0",
"react-dom": "16.9.0",
"react-test-renderer": "16.9.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-test-renderer": "16.13.1",
"symbol-observable": "^1.2.0",
"ts-node": "^7.0.0",
"typescript": "3.6.3",
Expand Down
12 changes: 6 additions & 6 deletions src/h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
createElement,
ReactElement,
ReactNode,
ReactType,
ElementType,
ReactHTML,
Attributes,
} from 'react';
Expand All @@ -17,7 +17,7 @@ type PropsLike<P> = P & PropsExtensions & Attributes;
type Children = string | Array<ReactNode>;

function createElementSpreading<P = any>(
type: ReactType<P> | keyof ReactHTML,
type: ElementType<P> | keyof ReactHTML,
props: PropsLike<P> | null,
children: Children,
): ReactElement<P> {
Expand All @@ -29,7 +29,7 @@ function createElementSpreading<P = any>(
}

function hyperscriptProps<P = any>(
type: ReactType<P> | keyof ReactHTML,
type: ElementType<P> | keyof ReactHTML,
props: PropsLike<P>,
): ReactElement<P> {
if (!props.sel) {
Expand All @@ -40,14 +40,14 @@ function hyperscriptProps<P = any>(
}

function hyperscriptChildren<P = any>(
type: ReactType<P> | keyof ReactHTML,
type: ElementType<P> | keyof ReactHTML,
children: Children,
): ReactElement<P> {
return createElementSpreading(type, null, children);
}

function hyperscriptPropsChildren<P = any>(
type: ReactType<P> | keyof ReactHTML,
type: ElementType<P> | keyof ReactHTML,
props: PropsLike<P>,
children: Children,
): ReactElement<P> {
Expand All @@ -59,7 +59,7 @@ function hyperscriptPropsChildren<P = any>(
}

export function h<P = any>(
type: ReactType<P> | keyof ReactHTML,
type: ElementType<P> | keyof ReactHTML,
a?: PropsLike<P> | Children,
b?: Children,
): ReactElement<P> {
Expand Down