|
|
@ -1,9 +1,10 @@
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
|
|
|
|
|
|
|
|
// third party
|
|
|
|
// third party
|
|
|
|
import { BrowserRouter } from 'react-router-dom';
|
|
|
|
import { BrowserRouter } from 'react-router-dom';
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { QueryClient, QueryClientProvider } from 'react-query';
|
|
|
|
import { MutationCache, QueryCache, QueryClient, QueryClientProvider } from 'react-query';
|
|
|
|
import { ReactQueryDevtools } from 'react-query/devtools';
|
|
|
|
import { ReactQueryDevtools } from 'react-query/devtools';
|
|
|
|
|
|
|
|
|
|
|
|
import { PersistGate } from 'redux-persist/integration/react';
|
|
|
|
import { PersistGate } from 'redux-persist/integration/react';
|
|
|
@ -20,6 +21,7 @@ import { ConfigProvider } from 'contexts/ConfigContext';
|
|
|
|
|
|
|
|
|
|
|
|
// style + assets
|
|
|
|
// style + assets
|
|
|
|
import 'assets/scss/style.scss';
|
|
|
|
import 'assets/scss/style.scss';
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
// ==============================|| REACT DOM RENDER ||============================== //
|
|
|
|
// ==============================|| REACT DOM RENDER ||============================== //
|
|
|
|
|
|
|
|
|
|
|
@ -35,23 +37,50 @@ const options = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const queryClient = new QueryClient();
|
|
|
|
const queryClient = new QueryClient({
|
|
|
|
|
|
|
|
mutationCache: new MutationCache({
|
|
|
|
|
|
|
|
onError: (error) => {
|
|
|
|
|
|
|
|
if (axios.isAxiosError(error)) {
|
|
|
|
|
|
|
|
const errorCode = error.response?.data.code;
|
|
|
|
|
|
|
|
console.log(`###################@@@@@@@@@@@@@@${errorCode}`); // 에러 팝업 띄우기
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
throw error; // error boundary로 전달
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
queryCache: new QueryCache({
|
|
|
|
|
|
|
|
onError: (error) => {
|
|
|
|
|
|
|
|
if (axios.isAxiosError(error)) {
|
|
|
|
|
|
|
|
const errorCode = error.response?.data.code;
|
|
|
|
|
|
|
|
console.log(`###################@@@@@@@@@@@@@@${errorCode}`); // 에러 팝업 띄우기
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
throw error; // error boundary로 전달
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
ReactDOM.render(
|
|
|
|
|
|
|
|
// <React.StrictMode>
|
|
|
|
<Provider store={store}>
|
|
|
|
<Provider store={store}>
|
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
|
<PersistGate loading={null} persistor={persister}>
|
|
|
|
<PersistGate loading={null} persistor={persister}>
|
|
|
|
<ConfigProvider>
|
|
|
|
<ConfigProvider>
|
|
|
|
<BrowserRouter basename={BASE_PATH}>
|
|
|
|
<BrowserRouter basename={BASE_PATH}>
|
|
|
|
<AlertProvider template={AlertTemplate} {...options}>
|
|
|
|
<AlertProvider template={AlertTemplate} {...options}>
|
|
|
|
|
|
|
|
{/* <React.StrictMode> */}
|
|
|
|
<App />
|
|
|
|
<App />
|
|
|
|
|
|
|
|
{/* </React.StrictMode> */}
|
|
|
|
</AlertProvider>
|
|
|
|
</AlertProvider>
|
|
|
|
</BrowserRouter>
|
|
|
|
</BrowserRouter>
|
|
|
|
</ConfigProvider>
|
|
|
|
</ConfigProvider>
|
|
|
|
</PersistGate>
|
|
|
|
</PersistGate>
|
|
|
|
|
|
|
|
{/* //TODO : 개발완료시 교체 */}
|
|
|
|
<ReactQueryDevtools initialIsOpen />
|
|
|
|
<ReactQueryDevtools initialIsOpen />
|
|
|
|
|
|
|
|
{/* <ReactQueryDevtools initialIsOpen={process.env.NODE_ENV !== 'production'} /> */}
|
|
|
|
</QueryClientProvider>
|
|
|
|
</QueryClientProvider>
|
|
|
|
</Provider>,
|
|
|
|
</Provider>,
|
|
|
|
|
|
|
|
// </React.StrictMode>,
|
|
|
|
document.getElementById('root')
|
|
|
|
document.getElementById('root')
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|