Victor Pham 1 年間 前
コミット
a47d974861
2 ファイル変更23 行追加23 行削除
  1. 1 0
      package.json
  2. 22 23
      src/index.tsx

+ 1 - 0
package.json

@@ -91,6 +91,7 @@
   },
   "dependencies": {
     "currency.js": "^2.0.4",
+    "regenerator-runtime": "^0.13.11",
     "usehooks-ts": "^2.9.1"
   }
 }

+ 22 - 23
src/index.tsx

@@ -1,24 +1,25 @@
-import React, { Suspense, useEffect } from 'react';
-import ReactDOM from 'react-dom';
-import { Switch, BrowserRouter, Route, useLocation } from 'react-router-dom';
-import { routes } from './routes';
-import { Provider, useDispatch, useSelector } from 'react-redux';
-import store from './store/store';
-import Loading from '@src/components/common/Loading';
-import Header from './components/common/Header';
-import Footer from './components/common/Footer';
-import { ACCESS_TOKEN } from './constants/Cookie';
-import AccessToken from './constants/AccessToken';
-import ScrollUtil from './utils/ScrollUtil';
-import { fetchUserInfo } from './store/reducers/UserReducer';
-import './index.scss';
-import NetworkLoading from './components/common/NetworkLoading';
-import CookieUtil from './utils/CookieUtil';
+import "regenerator-runtime/runtime";
+import React, { Suspense, useEffect } from "react";
+import ReactDOM from "react-dom";
+import { Switch, BrowserRouter, Route, useLocation } from "react-router-dom";
+import { routes } from "./routes";
+import { Provider, useDispatch, useSelector } from "react-redux";
+import store from "./store/store";
+import Loading from "@src/components/common/Loading";
+import Header from "./components/common/Header";
+import Footer from "./components/common/Footer";
+import { ACCESS_TOKEN } from "./constants/Cookie";
+import AccessToken from "./constants/AccessToken";
+import ScrollUtil from "./utils/ScrollUtil";
+import { fetchUserInfo } from "./store/reducers/UserReducer";
+import "./index.scss";
+import NetworkLoading from "./components/common/NetworkLoading";
+import CookieUtil from "./utils/CookieUtil";
 
 const Main = () => {
   const dispatch = useDispatch();
   const location = useLocation();
-  const { isLoading } = useSelector(store => store.networkLoading);
+  const { isLoading } = useSelector((store) => store.networkLoading);
 
   useEffect(() => {
     const accessToken = CookieUtil.getCookie(ACCESS_TOKEN);
@@ -37,18 +38,16 @@ const Main = () => {
   return (
     <Suspense fallback={<Loading />}>
       <Header />
-      {
-        isLoading && <NetworkLoading />
-      }
+      {isLoading && <NetworkLoading />}
       <Switch>
-        {routes.map((route, index) =>
+        {routes.map((route, index) => (
           <Route
             key={index}
             exact={route.exact}
             path={route.path}
             component={route.component}
           />
-        )}
+        ))}
       </Switch>
       <Footer />
     </Suspense>
@@ -65,4 +64,4 @@ const App = () => {
   );
 };
 
-ReactDOM.render(<App />, document.getElementById('root'));
+ReactDOM.render(<App />, document.getElementById("root"));