scrimba
React Bootcamp Course
Redux in React - Redux Thunk
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 - Redux Thunk
AboutCommentsNotes
Redux in React - Redux Thunk
Expand for more info
App.js
run
preview
console
import React from "react"
import {useSelector, useDispatch} from "react-redux"
import {increment, decrement} from "./redux"

function App(props) {
const count = useSelector(state => state)
const dispatch = useDispatch()
return (
<div>
<h1>{count}</h1>
<button onClick={() => dispatch(decrement())}>-</button>
<button onClick={() => dispatch(increment())}>+</button>
</div>
)
}

export default App
Console
1
,
2
,
3
,
4
,
3
,
2
,
1
,
0
,
/index.html
-12:59