We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8923c65 commit 263df0fCopy full SHA for 263df0f
src/05-generics/44-generics-vs-discriminated-unions.solution.tsx
@@ -5,19 +5,18 @@
5
* are passed in for each variant.
6
*/
7
8
-export type ModalProps =
+export type ModalProps = {
9
+ isOpen: boolean;
10
+} & (
11
| {
- isOpen: boolean;
- } & (
12
- | {
13
- variant: "with-button";
14
- buttonLabel: string;
15
- onButtonClick: () => void;
16
- }
17
18
- variant: "without-button";
19
20
- );
+ variant: "with-button";
+ buttonLabel: string;
+ onButtonClick: () => void;
+ }
+ | {
+ variant: "without-button";
+);
21
22
export const Modal = (props: ModalProps) => {
23
// ...
0 commit comments