Skip to content

Commit 66891d8

Browse files
committed
Changed 49
1 parent aa09e15 commit 66891d8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/06-advanced-hooks/49-use-state-overloads.solution.1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ const example2 = maybeReturnsString();
1717

1818
type tests = [
1919
Expect<Equal<typeof example1, string>>,
20-
Expect<Equal<typeof example2, string | undefined>>,
20+
Expect<Equal<typeof example2, string | undefined>>
2121
];

src/06-advanced-hooks/49-use-state-overloads.solution.2.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Equal, Expect } from "../helpers/type-utils";
77

88
function maybeReturnsString(defaultString: string): string;
99
function maybeReturnsString(
10-
defaultString?: string | undefined,
10+
defaultString?: string | undefined
1111
): string | undefined;
1212
function maybeReturnsString(defaultString?: string) {
1313
// If you pass a string, it always returns a string
@@ -20,9 +20,9 @@ function maybeReturnsString(defaultString?: string) {
2020
}
2121

2222
const example1 = maybeReturnsString("hello");
23-
const example2 = maybeReturnsString();
23+
const example2 = maybeReturnsString(undefined);
2424

2525
type tests = [
2626
Expect<Equal<typeof example1, string>>,
27-
Expect<Equal<typeof example2, string | undefined>>,
27+
Expect<Equal<typeof example2, string | undefined>>
2828
];

0 commit comments

Comments
 (0)