✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
A student wrote this. The phone is in airplane mode when the screen opens. What does the user see?
const load = async () => {
try {
setLoading(true);
const response = await fetch(BASE_URL + '/users');
setContacts(await response.json());
setLoading(false);
} catch (e) {
setError('Could not load contacts.');
}
};
if (loading) return <ActivityIndicator size="large" />;
if (error) return <Text>{error}</Text>;