✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
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>;