Skip to content

<ReactList> - The Root Component

The root component that wires everything together. It manages the entire data lifecycle — state, filters, pagination, search, and API calls — and provides context for all child components.

It’s the only component you must include. Every other component depends on the context provided by <ReactList>.

js
<ReactList>
  <ReactListItems>
    {/* Render your list items here */}
    {({ items }) => (
      <div>
        {items.map((item) => (
          <pre key={item.id}>{item}</pre>
        ))}
      </div>
    )}
  </ReactListItems>
</ReactList>

Props

PropDefaultType
endpointString - required
The unique identifier for the data source. Passed to the requestHandler. It can be a URL or part of URL.
page1Number
Initial page value.
perPage25Number
Initial number of items per page.
sortByString
Initial sorting field.
sortOrderdescString
Initial sorting direction. Should be either asc or desc.
searchString
Initial search term.
requestHandlerOverride the global requestHandler defined during plugin setup — ideal for module-specific logic.
versionString Number
Optional identifier for stateManager. You can use this with endpoint to generate new unique keys for state and delete old stale keys.
hasPaginationHistorytrueBoolean
ReactList will append the current page number to the URL query params — improving back button support.
paginationModepaginationString
pagination: Shows page numbers and traditional navigation.
loadMore: Loads more items on scroll or button click.

Events

NameArgumentsDescription
onItemSelectWIP
onResponseWIP
afterPageChangeWIP
afterLoadMoreWIP

children

children as function

You can use children as function to render the list items based on your needs. It exposes a set of scoped variables that let you access and render the list state however you like.

children as function callback Props

KeyDescription
itemsArray
Array of items returned from the API
responseObject
Full response object from the requestHandler
isLoadingBoolean
Indicating whether the list is currently loading
selectionArray
Object containing selected item(s) if selection is enabled
errorError object if the request failed
isEmptyBoolean
Indicating if the items array is empty
contextObject
The full context object same as passed to the requestHandler and stateManager
refreshFunction
Function to manually trigger a refetch