import { createContext } from 'react' ; import { PaginationPayload , Record , SortPayload } from '../../types' ; example export const ReferenceArrayInputContext = createContext ( undefined ) ; export interface ReferenceArrayInputContextValue { choices : Record [ ] ; error ? : any ; warning ? : any ; loading : boolean ; loaded : boolean ; setFilter : ( filter : any ) => void ; setPagination : ( pagination : PaginationPayload ) => void ; setSort : ( sort : SortPayload ) => void ; setSortForList : ( sort : string , order ? : string ) => void ; }