redux basic store

Tell us what’s happening:

Your code so far


const reducer = (state = 5) => {
return state;
}

// Redux methods are available from a Redux object
// For example: Redux.createStore()
// Define the store here:

const appStore = createStore(reducer)

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.105 Safari/537.36.

Challenge: Create a Redux Store

Link to the challenge:

Hey there,

if you re-read the description, it says:

Declare a store variable and assign it to the createStore() method, passing in the reducer as an argument.

You need to change one small thing!

Hi there,
I have write something like this
const store = createStore(reducer)

but still not working

Working :slight_smile:

There is an error in the log, stating:

ReferenceError: createStore is not defined

This means that the program can’t find createStore.

Have a closer look at the commented code:

// Redux methods are available from a Redux object
// For example: Redux.createStore()
// Define the store here:

Working , Thank you :slight_smile:

1 Like