Skip to content

Commit

Permalink
feat: recoilRoot 적용
Browse files Browse the repository at this point in the history
Issues: #378
Signed-off-by: SeoJunhwan <[email protected]>
  • Loading branch information
Seojunhwan committed Nov 18, 2022
1 parent 509738c commit 09d3ba1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/common/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ReactNode } from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { RecoilRoot } from 'recoil';

import defaultThemeV1 from '@/styles/theme';
import defaultThemeV2 from '@/styles/themeV2';
Expand All @@ -23,12 +24,14 @@ function Providers({ children }: Props) {
return (
<>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={defaultThemeV1}>
<ThemeProvider theme={defaultThemeV2}>
<Router basename="/">{children}</Router>
<ReactQueryDevtools initialIsOpen={false} />
<RecoilRoot>
<ThemeProvider theme={defaultThemeV1}>
<ThemeProvider theme={defaultThemeV2}>
<Router basename="/">{children}</Router>
<ReactQueryDevtools initialIsOpen={false} />
</ThemeProvider>
</ThemeProvider>
</ThemeProvider>
</RecoilRoot>
</QueryClientProvider>
</>
);
Expand Down
6 changes: 6 additions & 0 deletions src/recoil/atoms/modalAtom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { atom } from 'recoil';

export const isModalOpenState = atom({
key: 'isModalOpenState',
default: false,
});

0 comments on commit 09d3ba1

Please sign in to comment.