code handover
This commit is contained in:
60
src/index.js
Normal file
60
src/index.js
Normal file
@@ -0,0 +1,60 @@
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
|
||||
// third-party
|
||||
import { Provider as ReduxProvider } from 'react-redux';
|
||||
|
||||
// scroll bar
|
||||
import 'simplebar/dist/simplebar.css';
|
||||
|
||||
// apex-chart
|
||||
import 'assets/third-party/apex-chart.css';
|
||||
import 'assets/third-party/react-table.css';
|
||||
|
||||
// project import
|
||||
import App from './App';
|
||||
import { store } from 'store';
|
||||
// import { ConfigProvider } from 'contexts/ConfigContext';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
|
||||
const container = document.getElementById('root');
|
||||
const root = createRoot(container);
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 0,
|
||||
refetchOnWindowFocus: true,
|
||||
refetchOnReconnect: true,
|
||||
// refetchOnMount: true,
|
||||
refetchOnMount: 'always'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
console.log = () => {}; // Disable console.log in production
|
||||
console.error = () => {}; // Optionally disable console.error
|
||||
console.warn = () => {}; // Optionally disable console.warn
|
||||
}
|
||||
|
||||
// const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
|
||||
// ==============================|| MAIN - REACT DOM RENDER ||============================== //
|
||||
|
||||
root.render(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ReduxProvider store={store}>
|
||||
{/* <ConfigProvider> */}{' '}
|
||||
<BrowserRouter>
|
||||
<App />
|
||||
</BrowserRouter>
|
||||
{/* </ConfigProvider> */}
|
||||
</ReduxProvider>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
|
||||
// If you want to start measuring performance in your app, pass a function
|
||||
// to log results (for example: reportWebVitals(console.log))
|
||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
||||
reportWebVitals();
|
||||
Reference in New Issue
Block a user