import { useContext } from 'react' ; import ListSortContext , { ListSortContextValue } from './ListSortContext' ; typedef ListSortContextValue prop { Object } currentSort prop { Function } setSort prop { string } resource returns { ListSortContextValue } see useListController const useListSortContext = ( props ? ) : ListSortContextValue => { const context = useContext ( ListSortContext ) ; if ( ! context . setSort ) { deprecated if ( process . env . NODE_ENV !== 'production' ) { console . log ( "List components must be used inside a <ListContextProvider>. Relying on props rather than context to get List data and callbacks is deprecated and won't be supported in the next major version of react-admin." ) ; } return props ; } return context ; } ; export default useListSortContext ;