Skip to content

Commit

Permalink
test: Storybook에 Router 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
feb-dain committed May 16, 2023
1 parent 0df6232 commit fe4dad2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/stories/components/common/Header.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meta } from '@storybook/react';
import { BrowserRouter } from 'react-router-dom';
import { RecoilRoot } from 'recoil';
import HeaderComponent from '../../../components/common/Header';

Expand All @@ -9,11 +10,13 @@ const meta = {
decorators: [
(Story) => {
return (
<RecoilRoot>
<div style={{ width: 'calc(100vw - 32vw)' }}>
<Story />
</div>
</RecoilRoot>
<BrowserRouter>
<RecoilRoot>
<div style={{ width: 'calc(100vw - 32vw)' }}>
<Story />
</div>
</RecoilRoot>
</BrowserRouter>
);
},
],
Expand Down
9 changes: 6 additions & 3 deletions src/stories/pages/MainPage.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meta } from '@storybook/react';
import { BrowserRouter } from 'react-router-dom';
import { RecoilRoot } from 'recoil';
import MainPage from '../../pages/MainPage';

Expand All @@ -11,8 +12,10 @@ export default meta;

export const Main = () => {
return (
<RecoilRoot>
<MainPage />
</RecoilRoot>
<BrowserRouter>
<RecoilRoot>
<MainPage />
</RecoilRoot>
</BrowserRouter>
);
};

0 comments on commit fe4dad2

Please sign in to comment.