import React , { MutableRefObject , ReactElement , RefAttributes , forwardRef , } from "react" ; import { GroupBase , SelectInstance } from "react-select" ; import AsyncCreatableReactSelect , { AsyncCreatableProps , } from "react-select/async-creatable" ; import useChakraSelectProps from "./use-chakra-select-props" ; type AsyncCreatableSelectType = < Option = unknown , IsMulti extends boolean = false , Group extends GroupBase < Option > = GroupBase < Option > > ( props : AsyncCreatableProps < Option , IsMulti , Group > & RefAttributes < SelectInstance < Option , IsMulti , Group > > ) => ReactElement ; const AsyncCreatableSelect = forwardRef ( < Option , IsMulti extends boolean , Group extends GroupBase < Option > > ( props , ref ) => { const chakraSelectProps = useChakraSelectProps ( props ) ; return < AsyncCreatableReactSelect ref = { ref } { ... chakraSelectProps } />; } ) as AsyncCreatableSelectType ; export default AsyncCreatableSelect ;