Skip to content

Commit

Permalink
fix(type): improve generic types
Browse files Browse the repository at this point in the history
  • Loading branch information
fujikky committed Jun 2, 2020
1 parent 97e8836 commit 8d4374b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ export type FunctionComponentPropsBase = {
children?: JSX.Element[];
};

export type FunctionComponent<P = {}> = (
export type FunctionComponent<P = unknown> = (
props: P & FunctionComponentPropsBase
) => JSX.Element | null;

export type FC<P = {}> = FunctionComponent<P>;
export type FC<P = unknown> = FunctionComponent<P>;
6 changes: 3 additions & 3 deletions src/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ declare global {
"xml:lang": string;
}>;

p: ElementWithChildren<{}>;
p: ElementWithChildren<unknown>;

phoneme: ElementWithChildren<{
alphabet: "ipa" | "x-sampa";
Expand All @@ -68,7 +68,7 @@ declare global {
| string;
}>;

s: ElementWithChildren<{}>;
s: ElementWithChildren<unknown>;

"say-as": ElementWithChildren<{
"interpret-as":
Expand Down Expand Up @@ -100,7 +100,7 @@ declare global {
| "y";
}>;

speak: ElementWithChildren<{}>;
speak: ElementWithChildren<unknown>;

sub: ElementWithChildren<{
alias: string;
Expand Down

0 comments on commit 8d4374b

Please sign in to comment.