Keep any types for selects

This commit is contained in:
Isaac Wise 2024-07-27 17:45:54 -05:00
parent 94be3a7448
commit d631754b50
No known key found for this signature in database
GPG Key ID: A02A33A7E2427136
2 changed files with 10 additions and 11 deletions

View File

@ -4,17 +4,17 @@ import { useEffect, useState } from "react";
import { styles } from "./styles"; import { styles } from "./styles";
import { Options } from "./types"; import { Options } from "./types";
import CreatableSelect from "react-select/creatable"; import CreatableSelect from "react-select/creatable";
import Select, { ActionMeta } from "react-select"; import Select from "react-select";
type Props = { type Props = {
onChange: (newValue: unknown, actionMeta: ActionMeta<unknown>) => void; onChange: any;
showDefaultValue?: boolean; showDefaultValue?: boolean;
defaultValue?: defaultValue?:
| { | {
label: string; label: string;
value?: number; value?: number;
} }
| undefined; | undefined;
creatable?: boolean; creatable?: boolean;
}; };
@ -107,7 +107,7 @@ export default function CollectionSelection({
components={{ components={{
Option: customOption, Option: customOption,
}} }}
// menuPosition="fixed" // menuPosition="fixed"
/> />
); );
} else { } else {
@ -123,7 +123,7 @@ export default function CollectionSelection({
components={{ components={{
Option: customOption, Option: customOption,
}} }}
// menuPosition="fixed" // menuPosition="fixed"
/> />
); );
} }

View File

@ -3,10 +3,9 @@ import { useEffect, useState } from "react";
import CreatableSelect from "react-select/creatable"; import CreatableSelect from "react-select/creatable";
import { styles } from "./styles"; import { styles } from "./styles";
import { Options } from "./types"; import { Options } from "./types";
import { ActionMeta } from "react-select";
type Props = { type Props = {
onChange: (newValue: unknown, actionMeta: ActionMeta<unknown>) => void; onChange: any;
defaultValue?: { defaultValue?: {
value: number; value: number;
label: string; label: string;