Codepen says "Uncaught ReferenceError: applyMiddleware is not defined"

Tell us what’s happening:

Basically the title. I am trying to create a random quote machine with async react-redux using redux-thunk middleware. I have imported them in order in the settings (I think) and everything is working except for the “applyMiddleware” and “thunkMiddleware”. What I have tried:

  • Rearranging the load order of cdns;
  • Adding:
  • Adding :
const { createStore, applyMiddleware } = Redux;
const { Provider, connect } = ReactRedux;
const thunk = ReduxThunk.default;

But it still gives me an error Uncaught ReferenceError: applyMiddleware is not defined

Your code so far
Link to the codepen:

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36.

Challenge: Build a Random Quote Machine

Link to the challenge:

Nevermind! Found out the problem. I had to add:

const { applyMiddleware } = Redux;

and within the createStore I had to change it from:

const store = Redux.createStore(QuoteReducer, applyMiddleware(thunkMiddleware));


const store = Redux.createStore(QuoteReducer, applyMiddleware(ReduxThunk.default));