index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //全局变量
  2. import './Global'
  3. import React from 'react';
  4. import ReactDOM from 'react-dom/client';
  5. import App from './App';
  6. import {BrowserRouter} from 'react-router-dom';
  7. import {ThemeProvider} from '@contexts/themeContext';
  8. import {ShopProvider} from '@contexts/shopContext';
  9. import {Provider} from 'react-redux';
  10. import store from './app/store';
  11. import * as Sentry from "@sentry/react";
  12. global.dispatch=store.dispatch;
  13. // Sentry.init({
  14. // dsn: "https://4686ef0d926e140fb482e63efcde1cdf@o4507102375641088.ingest.us.sentry.io/4507102380687360",
  15. // integrations: [
  16. // Sentry.browserTracingIntegration(),
  17. // Sentry.replayIntegration(),
  18. // ],
  19. // // Performance Monitoring
  20. // tracesSampleRate: 1.0, // Capture 100% of the transactions
  21. // // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
  22. // tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
  23. // // Session Replay
  24. // replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
  25. // replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
  26. // });
  27. const root = ReactDOM.createRoot(document.getElementById('root'));
  28. root.render(
  29. <Provider store={store}>
  30. <BrowserRouter>
  31. <ThemeProvider>
  32. <ShopProvider>
  33. <App/>
  34. </ShopProvider>
  35. </ThemeProvider>
  36. </BrowserRouter>
  37. </Provider>
  38. );