react-admin
react-admin copied to clipboard
Possibility to pass additional data in the server response for getList
An API might want to send additional data since all the data isn't send when using pagination
The useListContext() hook, as documented here, provides only data and total, not additional values sent back by getList()
The solutions that could be implemented to allow this mechanism are not practical at all (feel free to explain it here if you were to find one)
I also found this stackoverflow question that raises the same issue
Here is an example using chips to show a summary of all the data (not working since the feature doesn't exist) :
This has been proposed in the past (see https://github.com/marmelab/react-admin/pull/4834), but the added complexity is non-negligible.
It's also possible to do it with a custom data provider method (e.g. getListMetadata). Your data provider can store the metadata from a getList response in a local cache, and return it in the getListMetadata response.
I'm open to a PR implementing this feature, but it's not an easy task, and probably not something the core team will woek on in the forseeable future.