links: React Native MOC
Setup
In order to understand the root cause of crashes for production users tools like Sentry can be your friend. in order to integrate follow these steps
- Add
yarn add @sentry/react-nativeSentry’s React Native Package to your app - Sentry provides a wizard package which can be used to automatically setup the project. Use this command to do setup automatically
npx @sentry/wizard -i reactNative -p ios android- If you have iOS project do
npx pod install - Now in your
App.jsfile initialize the Sentry SDK
import * as Sentry from "@sentry/react-native";
Sentry.init({
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
});- Finally wrap your app with Sentry
const SentryApp = Sentry.wrap(App)
export default codePush(codePushOptions)(SentryApp);if you are using code push, ensure it’s the outermost function because it needs access to the root component in order to swap out the bundle.
tags: react-native error sources: