Bugsnag
Issue
- createBoundary() undefined in Debug mode
Install Bugsnag
react-native/#installation
import { ErrorView } from 'src/components'
import Bugsnag from '@bugsnag/react-native';
Bugsnag.start();
const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React);
const App = () => {
...
}
export default () => (
<ErrorBoundary FallbackComponent={ErrorView}>
<App />
</ErrorBoundary>
);
Notify error for try/ catch
try {
const response = await fetchData( ... );
} catch (error) {
Bugsnag.notify(error);
}
Notify message with data and type (not for free plan(?))
var metadata = {
from: 'moka',
to: 'french press'
}
Bugsnag.leaveBreadcrumb('Preference updated', metadata, 'state')
// types: 'navigation', 'request', 'process', 'log', 'user', 'state', 'error', 'manual'
Leave a Reply