Skip to content

Commit 0875888

Browse files
committed
Changed 35 solution
1 parent a720150 commit 0875888

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/05-generics/35-type-helpers-2.solution.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { ChangeEventHandler } from "react";
22

3-
type AllOrNothing<T> =
4-
| T
5-
| {
6-
[K in keyof T]?: undefined;
7-
};
3+
type AllOrNothing<T> = T | ToUndefinedObject<T>;
4+
5+
type ToUndefinedObject<T> = Partial<Record<keyof T, undefined>>;
86

97
export type InputProps = AllOrNothing<{
108
value: string;

0 commit comments

Comments
 (0)