mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-11-18 07:22:06 +00:00
Fix Select types
This commit is contained in:
@@ -15,8 +15,7 @@ import AsyncSelect from "react-select/async";
|
||||
import { Prettify } from "@/types";
|
||||
|
||||
import { Field, GenericFieldProps } from "./Field";
|
||||
import { classNames } from "./Select";
|
||||
import { BaseOption } from "./SelectField";
|
||||
import { BaseOption, classNames } from "./Select";
|
||||
|
||||
export type AsyncSelectFieldProps<
|
||||
TFieldValues extends FieldValues = FieldValues,
|
||||
|
||||
@@ -62,10 +62,7 @@ export type SelectProps<
|
||||
T = string,
|
||||
D = unknown,
|
||||
> = Prettify<
|
||||
Omit<
|
||||
Props<BaseOption<T, D>, IsMulti, GroupBase<BaseOption<T, D>>>,
|
||||
"classNames"
|
||||
> & {
|
||||
Omit<Props<BaseOption<T, D>, IsMulti>, "classNames"> & {
|
||||
required?: boolean;
|
||||
separators?: boolean;
|
||||
hasError?: boolean;
|
||||
|
||||
@@ -10,18 +10,11 @@ import {
|
||||
} from "react-hook-form";
|
||||
import { GroupBase, OnChangeValue } from "react-select";
|
||||
|
||||
import { Select, SelectProps } from "@/components/form/Select";
|
||||
import { BaseOption, Select, SelectProps } from "@/components/form/Select";
|
||||
import { Prettify } from "@/types";
|
||||
|
||||
import { Field, GenericFieldProps } from "./Field";
|
||||
|
||||
export type BaseOption<T = string, D = unknown> = {
|
||||
value: T;
|
||||
label: string | JSX.Element;
|
||||
disabled?: boolean;
|
||||
data?: D;
|
||||
};
|
||||
|
||||
export type SelectFieldProps<
|
||||
TFieldValues extends FieldValues = FieldValues,
|
||||
TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
||||
|
||||
Reference in New Issue
Block a user