Skip to content

Commit 263df0f

Browse files
committed
Changed 44
1 parent 8923c65 commit 263df0f

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/05-generics/44-generics-vs-discriminated-unions.solution.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
* are passed in for each variant.
66
*/
77

8-
export type ModalProps =
8+
export type ModalProps = {
9+
isOpen: boolean;
10+
} & (
911
| {
10-
isOpen: boolean;
11-
} & (
12-
| {
13-
variant: "with-button";
14-
buttonLabel: string;
15-
onButtonClick: () => void;
16-
}
17-
| {
18-
variant: "without-button";
19-
}
20-
);
12+
variant: "with-button";
13+
buttonLabel: string;
14+
onButtonClick: () => void;
15+
}
16+
| {
17+
variant: "without-button";
18+
}
19+
);
2120

2221
export const Modal = (props: ModalProps) => {
2322
// ...

0 commit comments

Comments
 (0)