index.tsx 740 B

12345678910111213141516171819202122232425
  1. import React from 'react';
  2. import { createRoot } from 'react-dom/client';
  3. import { BrowserRouter } from 'react-router-dom';
  4. import { Provider } from 'react-redux';
  5. import { QueryClient, QueryClientProvider } from 'react-query';
  6. import App from 'components/App';
  7. import { store } from 'redux/store';
  8. import 'theme/index.scss';
  9. import 'lib/constants';
  10. const queryClient = new QueryClient();
  11. const container =
  12. document.getElementById('root') || document.createElement('div');
  13. const root = createRoot(container);
  14. root.render(
  15. <Provider store={store}>
  16. <BrowserRouter basename={window.basePath || '/'}>
  17. <QueryClientProvider client={queryClient}>
  18. <App />
  19. </QueryClientProvider>
  20. </BrowserRouter>
  21. </Provider>
  22. );