How to do it...

  1. Let's start by wiring the Redux store to the React Native app in App.js. We'll start with the imports, importing Provider from react-redux and the store we created earlier. We'll also import the Album component we'll be defining shortly, as follows:
import React, { Component } from 'react';import { StyleSheet, SafeAreaView } from 'react-native';import { Provider } from 'react-redux';import store from './redux';import Album from './components/Album';
  1. It's the job of the Provider to connect our Redux store to the React Native app so that the app's components can communicate with the store. Provider should be used to wrap the entire app, and since this app lives in the Album component, we'll wrap the Album component with ...

Get React Native Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.