π index.js
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { Provider } from 'react-redux';
import store from './redux/config/configStore';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<Provider store={store}>
<App />
</Provider>
);
reportWebVitals();
π App.jsx
import React from 'react'
const App = () => {
return (
<div>Thunk App</div>
)
}
export default App
π redux / config / configstore.js
import todos from "../modules/todosSlice";
import { configureStore } from "@reduxjs/toolkit";
const store = configureStore({
reducer: {
todos,
},
});
export default store;
π redux / modules / todosSlice.js
import { createSlice } from "@reduxjs/toolkit";
const initialState = {
todos: [],
}
export const todosSlice = createSlice({
name: "todos",
initialState,
reducers: {}
})
export const {} = todosSlice.actions;
export default todosSlice.reducer;
π db.json
{
"todos": []
}