scrimba
React Bootcamp Course
Redux in React - react-redux & Provider
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Redux in React - react-redux & Provider
AboutCommentsNotes
Redux in React - react-redux & Provider
Expand for more info
redux
index.js
run
preview
console
import redux, {createStore} from "redux"

function increment() {
return {
type: "INCREMENT"
}
}

function decrement() {
return {
type: "DECREMENT"
}
}

function reducer(count = 0, action) {
switch(action.type) {
case "INCREMENT":
return count + 1
case "DECREMENT":
return count - 1
default:
return count
}
}

const store = createStore(reducer)
store.subscribe(() => console.log(store.getState()))
export default store
Console
Error: Unknown require: react (in module /node_modules/react-redux/dist/react-redux.js) (/node_modules/react-redux/dist/react-redux.js:2)
,
/index.html
-3:39