1.2.0 • Published 3 years ago

react-native-error-manager v1.2.0

Weekly downloads
23
License
ISC
Repository
github
Last release
3 years ago

React Native Error Manager

This simple and very lightweight library will help to show users a error screen while any error happen in a production build.

Usage

import React from 'react'
import MyComponent from '../MyComponent'
import ErrorBoundary from 'react-native-error-manager'

export const Home = () => {
    return(
        <ErrorBoundary>
            <MyComponent />
        </ErrorBoundary>
    )
}

Custom error component

import React from 'react'
import {View, Text} from 'react-native'
import MyComponent from '../MyComponent'
import ErrorBoundary from 'react-native-error-manager'

export const Home = () => {

    const ErrorComponent = () => (
        <View style={{justifyContent:'center', alignItems: 'center', flex:1, backgroundColor: 'red'}}>
            <Text style={{fontSize: 30, color: '#fff', textAlign: 'center'}}>Hello this is error</Text>
        </View>
    )

    return(
        <ErrorBoundary component={<ErrorComponent />}>
            <MyComponent />
        </ErrorBoundary>
    )
}

Way to see the error

Sentry can be used for logging error with all the environments link - https://docs.sentry.io/platforms/react-native/

  • npm install --save @sentry/react-native
  • npx @sentry/wizard -i reactNative -p ios android
  • cd ios
  • pod install
1.2.0

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago