refactor: use redux

This commit is contained in:
boojack
2022-05-21 12:21:06 +08:00
parent 2e9152e223
commit c2e5a1a524
45 changed files with 674 additions and 1101 deletions

View File

@ -1,12 +1,9 @@
import { useContext } from "react";
import appContext from "./stores/appContext";
import { appRouterSwitch } from "./routers";
import { useAppSelector } from "./store";
import "./less/app.less";
function App() {
const {
locationState: { pathname },
} = useContext(appContext);
const pathname = useAppSelector((state) => state.location.pathname);
return <>{appRouterSwitch(pathname)}</>;
}