Skip to content

Commit 5345571

Browse files
committed
Fix InfiniteList stories share the same list state
1 parent dacbbe6 commit 5345571

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

packages/ra-ui-materialui/src/list/InfiniteList.stories.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
useInfinitePaginationContext,
99
} from 'ra-core';
1010
import { Box, Button, Card, Typography } from '@mui/material';
11+
import { MemoryRouter } from 'react-router-dom';
1112

1213
import { InfiniteList } from './InfiniteList';
1314
import { SimpleList } from './SimpleList';
@@ -101,12 +102,14 @@ const dataProvider = new Proxy(baseDataProvider, {
101102
});
102103

103104
const Admin = ({ children, dataProvider, layout }: any) => (
104-
<AdminContext
105-
dataProvider={dataProvider}
106-
i18nProvider={polyglotI18nProvider(() => defaultMessages, 'en')}
107-
>
108-
<AdminUI layout={layout}>{children}</AdminUI>
109-
</AdminContext>
105+
<MemoryRouter>
106+
<AdminContext
107+
dataProvider={dataProvider}
108+
i18nProvider={polyglotI18nProvider(() => defaultMessages, 'en')}
109+
>
110+
<AdminUI layout={layout}>{children}</AdminUI>
111+
</AdminContext>
112+
</MemoryRouter>
110113
);
111114

112115
const bookFilters = [<SearchInput source="q" alwaysOn />];

0 commit comments

Comments
 (0)