Skip to content

Commit

Permalink
chore: add MemoryRouter to decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
kang-kibong committed Oct 23, 2024
1 parent fa82881 commit 1dd5a2b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { Preview } from '@storybook/react';
import AppProviders from '../src/components/providers/index.provider';
import { initialize, mswLoader } from 'msw-storybook-addon';
import { handlers } from '../src/mocks/handlers';
import { MemoryRouter } from 'react-router-dom';

initialize();

Expand All @@ -21,9 +22,11 @@ const preview: Preview = {
tags: ['autodocs'],
decorators: [
(Story) => (
<AppProviders>
<Story />
</AppProviders>
<MemoryRouter>
<AppProviders>
<Story />
</AppProviders>
</MemoryRouter>
),
],
loaders: [mswLoader],
Expand Down

0 comments on commit 1dd5a2b

Please sign in to comment.