Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] recoil 라이브러리 설치 #48

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"@tanstack/react-query": "^5.51.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.24.1"
"react-router-dom": "^6.24.1",
"recoil": "^0.7.7"
},
"devDependencies": {
"@babel/cli": "^7.24.8",
Expand Down
11 changes: 7 additions & 4 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Global, ThemeProvider } from '@emotion/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import ReactDOM from 'react-dom/client';
import { RecoilRoot } from 'recoil';

import App from './App';
import GlobalStyle from './styles/GlobalStyle';
Expand All @@ -21,10 +22,12 @@ const enableMocking = async () => {
enableMocking().then(() => {
ReactDOM.createRoot(document.getElementById('root')!).render(
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={Theme}>
<Global styles={GlobalStyle} />
<App />
</ThemeProvider>
<RecoilRoot>
<ThemeProvider theme={Theme}>
<Global styles={GlobalStyle} />
<App />
</ThemeProvider>
</RecoilRoot>
</QueryClientProvider>,
);
});
11 changes: 7 additions & 4 deletions frontend/src/mocks/wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Global, ThemeProvider } from '@emotion/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { PropsWithChildren } from 'react';
import { RecoilRoot } from 'recoil';

import GlobalStyle from '@/styles/GlobalStyle';
import { Theme } from '@/styles/Theme';
Expand All @@ -16,10 +17,12 @@ const queryClient = new QueryClient({
const wrapper = ({ children }: PropsWithChildren) => {
return (
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={Theme}>
<Global styles={GlobalStyle} />
{children}
</ThemeProvider>
<RecoilRoot>
<ThemeProvider theme={Theme}>
<Global styles={GlobalStyle} />
{children}
</ThemeProvider>
</RecoilRoot>
Comment on lines +20 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recoil 초기 세팅 칭찬해 ~~~~

</QueryClientProvider>
);
};
Expand Down