State Management · Junior · Question 30 of 75

What are useSelector and useDispatch for?

Explanation

const count = useSelector(state => state.counter.value) re-renders the component only when the selected value changes. const dispatch = useDispatch(); dispatch(increment()) sends an action.

Further reading

Problem with a question

State Management · Junior · question 30

Test yourself

Take the State Management · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz