mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
refactor: use redux
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import React from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import Provider from "./labs/Provider";
|
||||
import appContext from "./stores/appContext";
|
||||
import appStore from "./stores/appStore";
|
||||
import { Provider } from "react-redux";
|
||||
import store from "./store";
|
||||
import { updateStateWithLocation } from "./store/modules/location";
|
||||
import App from "./App";
|
||||
import "./helpers/polyfill";
|
||||
import "./less/global.less";
|
||||
@ -12,8 +12,15 @@ const container = document.getElementById("root");
|
||||
const root = createRoot(container as HTMLElement);
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<Provider store={appStore} context={appContext}>
|
||||
<Provider store={store}>
|
||||
<App />
|
||||
</Provider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
window.onload = () => {
|
||||
store.dispatch(updateStateWithLocation());
|
||||
window.onpopstate = () => {
|
||||
store.dispatch(updateStateWithLocation());
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user