How to do it...

  1. We'll start by opening App.js and importing dependencies:
import React, { Component } from 'react';import {  SafeAreaView,  StyleSheet,  Text,  View,  Image,  TouchableOpacity,  Picker,  Dimensions,} from 'react-native';import Carousel from 'react-native-snap-carousel';
  1. Next, let's define the App class and the initial state object. The state has three properties: a Boolean for whether we're currently displaying the carousel or not, a layoutType property for setting the layout style of our carousel, and an array of imageSearchTerms we'll use later to get images from Unsplash Source. Feel free to change the imageSearchTerms array to your heart's content:
export default class App extends React.Component {  state = { showCarousel: ...

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.