UNPKG

@drieam/common

Version:

Default Drieam api wrapper

30 lines (23 loc) 663 B
--- menu: '@drieam/common' name: ApiTable route: /common/table --- ## `<ApiTable ...` Table Component who renders a loading or an error page depending of a `ListState`. #### Arguments 1. `listState` (`ListState<T>`): ListState state reducer. 1. `getRecords` (`() => void`): Callback to dispatch a fetch list action. 1. `defaultParams`: Filters of the fetch list action. #### Example ```jsx <ApiTable columns={...} defaultParams={{ include: ['course', 'meetings'], sort: ['start_date:desc'], }} listState={this.props.plannedCourseList} getRecords={this.props.getPlannedCourses} /> ```