@umituz/react-native-exception
v1.2.3
Published
Exception handling and error tracking for React Native apps
Downloads
457
Maintainers
Readme
@umituz/react-native-exception
Exception handling and error tracking for React Native apps.
Features
- Centralized exception handling
- Error boundary component
- Empty state component for no data scenarios
- Exception store with Zustand
- Error categorization and severity levels
- Exception reporting utilities
Installation
npm install @umituz/react-native-exceptionPeer Dependencies
react>= 18.2.0react-native>= 0.74.0zustand>= 5.0.2@umituz/react-native-design-system-theme>= 1.0.0@umituz/react-native-design-system>= 1.0.0
Usage
Error Boundary
import { ErrorBoundary } from '@umituz/react-native-exception';
<ErrorBoundary>
<YourApp />
</ErrorBoundary>Exception Service
import { exceptionService } from '@umituz/react-native-exception';
try {
// Your code
} catch (error) {
exceptionService.handleException(
error,
'error',
'business-logic',
{ userId: '123' }
);
}Exception Store
import { useExceptionStore } from '@umituz/react-native-exception';
const { exceptions, lastError } = useExceptionStore();Empty State
import { EmptyState } from '@umituz/react-native-exception';
<EmptyState
icon="inbox"
title="No items found"
description="Start by adding your first item"
actionLabel="Add Item"
onAction={() => navigation.navigate('Add')}
/>License
MIT
