Connecting Redux to React: Why react-redux Exists

Hands-on practice for this lecture. Write the code, see it run, understand the pattern.

1

Exercise 1 of 1

Wire Provider to the App

The store is ready but nothing can read it. Wrap the component tree with Provider — and watch useSelector start working.

Task

The Redux store is created in store.js and the component is in Tasks.js. Open App.js and wrap <Tasks /> with <Provider store={store}>.

Without Provider, useSelector and useDispatch cannot find the store and will throw. Add it and watch the task list appear.

Loading editor…
Practice: Connecting Redux to React: Why react-redux Exists — Interactive Exercises | Durgesh Rai