- 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';
- 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: ...