-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
2,211 additions
and
6,560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import React, { Suspense } from "react"; | ||
import ReactDOM from "react-dom"; | ||
import { createRoot } from "react-dom/client"; | ||
import i18n from "I18n/i18n.config"; | ||
import { I18nextProvider } from "react-i18next"; | ||
import Root from "Core/root"; | ||
import store, { history } from "Redux/store/store"; | ||
import { store, history } from "Redux/store/store"; | ||
import "bulma/css/bulma.css"; | ||
|
||
ReactDOM.render( | ||
const container = document.getElementById("target"); | ||
const root = createRoot(container); | ||
root.render( | ||
<I18nextProvider i18n={i18n}> | ||
<Suspense fallback="loading"> | ||
<Root store={store} history={history}></Root> | ||
</Suspense> | ||
</I18nextProvider>, | ||
document.getElementById("target") | ||
); | ||
</I18nextProvider> | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,43 @@ | ||
import { configureStore, getDefaultMiddleware } from "@reduxjs/toolkit"; | ||
import { createHashHistory } from "history"; | ||
import { routerMiddleware } from "connected-react-router"; | ||
import rootReducer from "../reducers/rootReducer"; | ||
import { | ||
combineReducers | ||
} from "redux"; | ||
import { | ||
configureStore, | ||
getDefaultMiddleware | ||
} from "@reduxjs/toolkit"; | ||
import { | ||
createHashHistory | ||
} from "history"; | ||
import { | ||
createReduxHistoryContext | ||
} from "redux-first-history"; | ||
import undoable from "easy-redux-undo"; | ||
import homeReducer from "../components/home/homeSlice"; | ||
import counterReducer from "../components/counter/counterSlice"; | ||
import complexReducer from "../components/complex/complexSlice"; | ||
|
||
export const history = createHashHistory(); | ||
const { | ||
routerMiddleware, | ||
createReduxHistory, | ||
routerReducer | ||
} = createReduxHistoryContext({ | ||
history: createHashHistory() | ||
}); | ||
|
||
const store = configureStore({ | ||
reducer: rootReducer(history), | ||
export const store = configureStore({ | ||
reducer: combineReducers({ | ||
router: routerReducer, | ||
home: homeReducer, | ||
undoable: undoable( | ||
combineReducers({ | ||
counter: counterReducer, | ||
complex: complexReducer | ||
}) | ||
) | ||
}), | ||
middleware: [...getDefaultMiddleware({ | ||
serializableCheck: false | ||
}), routerMiddleware(history)] | ||
}), routerMiddleware] | ||
}); | ||
|
||
export default store; | ||
export const history = createReduxHistory(store); |
Oops, something went wrong.