Skip to content
Advertisement

How can i disable the auto-refreshing feature of react-admin

So react-admin seems to have a feature where if you’re idle for a little while and come back it will reload the data, presumably to make sure you’re looking at the most up to date version of a record.

This is causing some issues for my editing feature that has some custom components. Is there a way to disable this auto-reload feature?

Advertisement

Answer

The auto-refresh is triggered by the loading indicator (the spinner icon that you see in the top right part of the app bar).

You can disable the auto-refresh by replacing the loading indicator by your own.

JavaScript

You’ll also need to put this button in a custom AppBar, inject your AppBar in a custom Layout, and use that Layout in your Admin, as explained in the react-admin Theming documentation.

Advertisement