I am trying to show a large list in react native - Expo. When i lock the screen while data loading via API. App State changed from "Active" to "Inactive". When i return to active state, no data has been loaded. The App processes are stopped. ListEmptyComponent renders the ActivityIndicator. It is loading indefinitely. It occurs only in android build.
I tried to recall the API by AppState.
const handleAppStateChange = nextAppState => {
console.log(nextAppState);
if (nextAppState === 'active') {
console.log(JSON.stringify(Store.apiCall));
// "Store.apiCall" has data about last API Call and its status.
if (Store.apiCall.status === codes.PENDING || Store.apiCall.status === codes.ERROR) {
api(Store.apiCall.payload);
}
}
setAppState(nextAppState);
};
Still it doesn't works..