index.js 697 B

1234567891011121314151617181920212223
  1. import React from 'react';
  2. import ReactDOM from 'react-dom/client';
  3. import './index.css';
  4. import App from './App';
  5. import reportWebVitals from './reportWebVitals';
  6. // 引入store实例
  7. import store from './store';
  8. // 引入 Provider组件
  9. import { Provider } from 'react-redux';
  10. const root = ReactDOM.createRoot(document.getElementById('root'));
  11. root.render(
  12. <React.StrictMode>
  13. <Provider store={store}>
  14. <App />
  15. </Provider>
  16. </React.StrictMode>
  17. );
  18. // If you want to start measuring performance in your app, pass a function
  19. // to log results (for example: reportWebVitals(console.log))
  20. // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
  21. reportWebVitals();