Skip to content

Instantly share code, notes, and snippets.

const asyncToken = callback => {
AsyncStorage.getItem('TOKEN').then(token => {
axios.defaults.headers = { authorization: token };
callback();
});
};
asyncToken(() => {
axios.get('http://localhost:3000/auth/testAuth').then((response) => {
alert(response.data);
import React, { Component } from 'react';
import { StyleSheet, Text, Button, SectionList, TouchableOpacity } from 'react-native';
class Collections extends Component {
static renderHeader(title) {
return (
<Text style={styles.header}>{title}</Text>
);
}