You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, `<List>` renders the `<Offline>` component when there is no connectivity and there are no records in the cache yet for the current parameters (page, sort, etc.). You can provide your own component via the `offline` prop:
781
+
782
+
```jsx
783
+
import { List } from'react-admin';
784
+
import { Alert } from'@mui/material';
785
+
786
+
constoffline=<Alert severity="warning">No network. Could not load the posts.</Alert>;
787
+
788
+
exportconstPostList= () => (
789
+
<List offline={offline}>
790
+
...
791
+
</List>
792
+
);
793
+
```
794
+
795
+
**Tip**: If the record is in the Tanstack Query cache but you want to warn the user that they may see an outdated version, you can use the `<IsOffline>` component:
796
+
797
+
```jsx
798
+
import { List, IsOffline } from'react-admin';
799
+
import { Alert } from'@mui/material';
800
+
801
+
constoffline=<Alert severity="warning">No network. Could not load the posts.</Alert>;
802
+
803
+
exportconstPostList= () => (
804
+
<List offline={offline}>
805
+
<IsOffline>
806
+
<Alert severity="warning">
807
+
You are offline, the data may be outdated
808
+
</Alert>
809
+
</IsOffline>
810
+
...
811
+
</List>
812
+
);
813
+
```
814
+
777
815
## `pagination`
778
816
779
817
By default, the `<List>` view displays a set of pagination controls at the bottom of the list.
0 commit comments