- We are going to display a timeline with images in the App class. Let's import all of the dependencies, including the two other components we'll build out in later steps, as follows:
import React, { Component } from 'react';import { Dimensions, Image, Text, ScrollView, StyleSheet, SafeAreaView,} from 'react-native';import PostContainer from './PostContainer';import PhotoViewer from './PhotoViewer';
- In this step, we'll define the data that we are going to render. It's just a simple array of objects containing title and image, as follows:
const image1 = require('./images/01.jpg');const image2 = require('./images/02.jpg');const image3 = require('./images/03.jpg');const image4 = require('./images/04.jpg');const timeline = [ ...