Skip to content

Commit 46043fb

Browse files
committed
Fixed 75 solution
1 parent a61f352 commit 46043fb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/09-external-libraries/75-react-select.solution.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import ReactSelect, { GroupBase, Props } from "react-select";
22
import { Equal, Expect } from "../helpers/type-utils";
33

4-
/**
5-
* You need to mimic the exact type of the Props type exported by react-select.
6-
*/
74
export const Select = <
8-
Option,
5+
Option = unknown,
96
IsMulti extends boolean = false,
107
Group extends GroupBase<Option> = GroupBase<Option>,
118
>(
@@ -34,6 +31,7 @@ const guitarists: Option[] = [
3431
<Select
3532
options={guitarists}
3633
onChange={(option) => {
34+
// It should infer the type of option!
3735
// If isMulti is false, it should NOT be an array
3836
type test = Expect<Equal<typeof option, Option | null>>;
3937
}}

0 commit comments

Comments
 (0)