- We'll start by opening App.js and importing the dependencies we will be using:
import React, { Component } from 'react';import { TouchableOpacity, StyleSheet, Text, View } from 'react-native';import { AuthSession } from 'expo';import { FontAwesome } from '@expo/vector-icons';
- Let's also declare the CLIENT_ID as a constant to be used later. Copy the client ID for the Spotify app we created previously so that we can save it in the CLIENT_ID const:
const CLIENT_ID = Your-Spotify-App-Client-ID;
- Let's create the App class and the initial state. The userInfo property will hold the user information we receive back from the Spotify API, and didError is a Boolean for tracking whether an error occurred during login:
export default ...