Connecting the store with the views

So far, we have set up the state, the middleware, and some actions to load data from hardcoded data and from a remote API. But we are not showing anything on screen; our react components don't have any access to the global state.

In this recipe we will enable components to access the store that we have defined, then we will render the categories on a list.

Getting ready

This recipe depends on all the previous ones; make sure to follow each recipe from the beginning.

On the first recipe of this chapter we installed the react-redux library. We are finally going to use it here. Make sure you have already installed it; otherwise, use npm or yarn to install it before going through the steps.

How to do it...

  1. We will start ...

Get React Native Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.