import * as React from 'react' ; import { ReactElement } from 'react' ; import PropTypes from 'prop-types' ; import { useCheckMinimumRequiredProps , useListController , ListContextProvider , } from 'ra-core' ; import { TitlePropType } from '../layout/Title' ; import ListView from './ListView' ; import { ListProps } from '../types' ; example const List = ( props ) : ReactElement => { useCheckMinimumRequiredProps ( 'List' , [ 'children' ] , props ) ; const controllerProps = useListController ( props ) ; return ( < ListContextProvider value = { controllerProps } > < ListView { ... props } { ... controllerProps } /> < /ListContextProvider>); } ; List . propTypes = { actions : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . element ] ) , aside : PropTypes . element , bulkActionButtons : PropTypes . oneOfType ( [ PropTypes . element , PropTypes . bool ] ) , children : PropTypes . element , classes : PropTypes . object , className : PropTypes . string , filter : PropTypes . object , filterDefaultValues : PropTypes . object , filters : PropTypes . oneOfType ( [ PropTypes . element , PropTypes . arrayOf ( PropTypes . element ) , ] ) , pagination : PropTypes . oneOfType ( [ PropTypes . element , PropTypes . bool ] ) , perPage : PropTypes . number . isRequired , sort : PropTypes . shape ( { field : PropTypes . string , order : PropTypes . string , } ) , title : TitlePropType , authProvider : PropTypes . func , hasCreate : PropTypes . bool , hasEdit : PropTypes . bool , hasList : PropTypes . bool , hasShow : PropTypes . bool , location : PropTypes . any , match : PropTypes . any , path : PropTypes . string , resource : PropTypes . string , syncWithLocation : PropTypes . bool , } ; List . defaultProps = { filter : { } , perPage : 10 , } ; export default List ;