Diego
Diego

Reputation: 89

Reducer exception

I'm just starting on my redux studied and already at the first try i cant find a solution to this exception.

The problem appears when i try to render my App wrapped in the Provider.

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';

const createStoreWithMiddleware = applyMiddleware()(createStore);

ReactDOM.render(
  <Provider store={createStoreWithMiddleware()}>
    <App />
  </Provider>,
  document.getElementById('root')
);

enter image description here

Upvotes: 0

Views: 36

Answers (1)

Benjamin
Benjamin

Reputation: 3656

createStore(rootReducer, preloadedState, composedEnhancers) accepts up to 3 arguments. The first argument, rootReducer is a required argument. You are missing a reducer.

Upvotes: 1

Related Questions