Skip to content

Instantly share code, notes, and snippets.

@MKS-01
Last active September 19, 2020 11:14
Show Gist options
  • Save MKS-01/727d2ee3397fdd5ad36bdf0e7f4bd8b8 to your computer and use it in GitHub Desktop.
Save MKS-01/727d2ee3397fdd5ad36bdf0e7f4bd8b8 to your computer and use it in GitHub Desktop.
Network Error Complete Implementation Code
import React from 'react';
import {View, Text, SafeAreaView, StyleSheet, Image} from 'react-native';
import CheckConnection from './utils/CheckConnetion';
const ErrorCard = () => {
return (
<View style={styles.errorContainer}>
{/*check github repo for design*/}
</View>
);
};
const NetworkTest = () => {
let network = CheckConnection();
if (network === false) {
return <ErrorCard />;
}
return (
<SafeAreaView style={styles.rootView}>
<View style={styles.rootContainer}>
{/*...
rest of component
...*/}
</View>
</SafeAreaView>
);
};
export default NetworkTest;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment