educative.io

Educative

1st example does not work for me

Can you help? I am getting this error:

Error: Expected the reducer to be a function.

createStore

node_modules/redux/es/redux.js:83

Module…/src/App.js

src/App.js:7

   4 | import reducer from "./reducers";   5 |    6 | const initialState = { tech: "React " };>  7 | const store = createStore(reducer, initialState);   8 |    9 | class App extends Component {  10 |   render() {

I got it to work after installing ‘npm install redux’. It is weird because previously I installed it with ‘npm install @reduxjs/toolkit’ (from: https://redux.js.org/introduction/installation) and redux toolkit is supposed to include core.