|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
|
|
|
|
|
|
// third party
|
|
|
|
|
import { BrowserRouter } from 'react-router-dom';
|
|
|
|
|
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 { PersistGate } from 'redux-persist/integration/react';
|
|
|
|
@ -20,6 +21,7 @@ import { ConfigProvider } from 'contexts/ConfigContext';
|
|
|
|
|
|
|
|
|
|
// style + assets
|
|
|
|
|
import 'assets/scss/style.scss';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
// ==============================|| 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(
|
|
|
|
|
// <React.StrictMode>
|
|
|
|
|
<Provider store={store}>
|
|
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
|
|
<PersistGate loading={null} persistor={persister}>
|
|
|
|
|
<ConfigProvider>
|
|
|
|
|
<BrowserRouter basename={BASE_PATH}>
|
|
|
|
|
<AlertProvider template={AlertTemplate} {...options}>
|
|
|
|
|
{/* <React.StrictMode> */}
|
|
|
|
|
<App />
|
|
|
|
|
{/* </React.StrictMode> */}
|
|
|
|
|
</AlertProvider>
|
|
|
|
|
</BrowserRouter>
|
|
|
|
|
</ConfigProvider>
|
|
|
|
|
</PersistGate>
|
|
|
|
|
{/* //TODO : 개발완료시 교체 */}
|
|
|
|
|
<ReactQueryDevtools initialIsOpen />
|
|
|
|
|
{/* <ReactQueryDevtools initialIsOpen={process.env.NODE_ENV !== 'production'} /> */}
|
|
|
|
|
</QueryClientProvider>
|
|
|
|
|
</Provider>,
|
|
|
|
|
// </React.StrictMode>,
|
|
|
|
|
document.getElementById('root')
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|