Example
Render a list and automatically get access to type-safe data. Pick between normal, infinite, and paginated modes. Optionally pass a query.Props
'normal' | 'infinite' | 'paginated'
default:"normal"
The list rendering mode. ‘normal’ loads all data at once, ‘infinite’ loads more as you scroll, and ‘paginated’ uses page-based navigation.
string
required
The name of the entity/model to query from the database.
(item: T, id: string) => ReactNode
required
Function to render each item in the list. Receives the item data and its ID.
object
The query object to filter and sort the data. If not provided, fetches all records of the entity.
ReactNode
Component to show while data is loading.
ReactNode
Component to show when there are no results or an error occurs.
number
default:10
Number of items per page (only for ‘infinite’ and ‘paginated’ modes).
PaginationState
Required when mode is ‘paginated’. Pagination state object from useIDBPagination hook