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

[FE] Refactor/#643: Profile 페이지 API 로직 수정 및 React-Query 적용 #647

Merged
merged 12 commits into from
Jan 18, 2024
Prev Previous commit
Next Next commit
refactor: tanstack query 기본 설정 추가
GC-Park committed Jan 17, 2024
commit 0422d45e433087d9319eaa7cdb8b954b5050fb1f
17 changes: 11 additions & 6 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ReactDOM from 'react-dom/client';
import ReactGA from 'react-ga4';
import { ThemeProvider } from 'styled-components';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

import App from './App';
import ErrorBoundary from './components/ErrorBoundary';
@@ -12,6 +13,8 @@ const rootElement = document.getElementById('root');
if (!rootElement) throw new Error('Failed to find the root element');
const root = ReactDOM.createRoot(rootElement);

const queryClient = new QueryClient();

// if (process.env.NODE_ENV === 'development') {
// const { worker } = require('./mocks/browser');
// worker.start({ quiet: true });
@@ -22,10 +25,12 @@ if (process.env.REACT_APP_GOOGLE_ANALYTICS) {
}

root.render(
<ThemeProvider theme={theme}>
<GlobalStyle />
<ErrorBoundary fallback={NotFound}>
<App />
</ErrorBoundary>
</ThemeProvider>,
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>
<GlobalStyle />
<ErrorBoundary fallback={NotFound}>
<App />
</ErrorBoundary>
</ThemeProvider>
</QueryClientProvider>,
);