import React, { SelectHTMLAttributes } from 'react'; import Select from 'react-select'; import { Controller, Path } from 'react-hook-form'; import { Control } from 'react-hook-form/dist/types/form'; import { FieldValues } from 'react-hook-form/dist/types/fields'; import { FieldPath } from 'react-hook-form/dist/types/path'; import { FieldPathValue, UnpackNestedValue } from 'react-hook-form/dist/types'; interface FabSelectProps extends SelectHTMLAttributes { id: string, label?: string, className?: string, control: Control, placeholder?: string, options: Array>, valueDefault?: TOptionValue, } /** * Option format, expected by react-select * @see https://github.com/JedWatson/react-select */ type selectOption = { value: TOptionValue, label: string }; /** * This component is a wrapper for react-select to use with react-hook-form */ export const FabSelect = ({ id, label, className, control, placeholder, options, valueDefault }: FabSelectProps) => { return (