
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@umituz-org/react-native-offline
Advanced tools
Network connectivity state management for React Native apps - Offline detection, online/offline state tracking
Network connectivity state management for React Native apps - Offline detection, online/offline state tracking.
npm install @umituz/react-native-offline
npm install @react-native-community/netinfo zustand
import { useOffline } from '@umituz/react-native-offline';
function MyComponent() {
const { isOnline, isOffline, connectionType } = useOffline();
if (isOffline) {
return <OfflineBanner />;
}
return <YourContent />;
}
import { useOfflineState } from '@umituz/react-native-offline';
function MyComponent() {
const isOffline = useOfflineState((state) => state.isOffline);
return (
<View>
{isOffline && <Text>You are offline</Text>}
</View>
);
}
import { useOfflineWithMutations } from '@umituz/react-native-offline';
function MyComponent() {
const { isOnline, isOffline } = useOfflineWithMutations(async () => {
// Sync data when coming back online
await syncLocalData();
});
if (isOffline) {
return <OfflineBanner />;
}
return <YourContent />;
}
import { useOfflineStore } from '@umituz/react-native-offline';
function TestComponent() {
const store = useOfflineStore();
const handleForceOffline = () => {
store.setOffline();
};
const handleForceOnline = () => {
store.setOnline();
};
return (
<View>
<Button onPress={handleForceOffline} title="Force Offline" />
<Button onPress={handleForceOnline} title="Force Online" />
</View>
);
}
useOffline()Primary hook for accessing offline state. Automatically subscribes to network changes.
Returns:
isOnline: boolean - Whether device is onlineisOffline: boolean - Whether device is offlineconnectionType: string | null - Connection type (wifi, cellular, etc.)isInternetReachable: boolean | null - Whether internet is reachablelastOnlineAt: Date | null - Last time device was onlinelastOfflineAt: Date | null - Last time device went offlinehasConnection: boolean - Alias for isOnlinehasInternet: boolean - Whether device has internet accessuseOfflineState()Raw store access hook. Use when you don't need automatic NetInfo subscription.
Returns: Zustand store instance
useOfflineWithMutations(onOnline)Enhanced version of useOffline that automatically calls a callback when coming back online.
Parameters:
onOnline: () => Promise<void> - Function to call when device comes back online (e.g., sync data)Returns: Same as useOffline()
useOfflineStoreZustand store for offline state management.
Methods:
updateNetworkState(state: NetInfoState) - Update network state from NetInfosetOnline() - Manually set online statesetOffline() - Manually set offline stateMIT
Ümit UZ umit@umituz.com
FAQs
Network connectivity state management for React Native apps - Offline detection, online/offline state tracking
The npm package @umituz-org/react-native-offline receives a total of 0 weekly downloads. As such, @umituz-org/react-native-offline popularity was classified as not popular.
We found that @umituz-org/react-native-offline demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.