Sharing an image with text as a blog post with React Native and Expo
In this section, we will learn how to let users upload images as part of a blog post to an S3 Bucket via the built-in Amplify Storage service. We will look at both the Expo and React Native projects, and point out the differences between the two. Open the App.tsx
file in your Expo or React Native project and follow these steps:
- First, we must import the required libraries; that is, the React and React Native UI components:
import React, { useEffect, useState, SetStateAction } from "react"; import { View, Text, SafeAreaView, ScrollView, Image, TextInput } from "react-native"; import { StatusBar } from 'expo-status-bar'; import styles from "./AppStyles"; import Amplify, { Auth, API, graphqlOperation, Storage } from "aws-amplify"; import * as mutations from "./src/graphql/mutations"...