Skip to content

Fix React Native Onboarding Option Buttons #12813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions docs/platforms/react-native/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ Select which Sentry features you'd like to install in addition to Error Monitori

## Install

<OnboardingOptionButtons
options={[
'error-monitoring',
'performance',
'profiling',
]}
/>

Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works.

To install, run `@sentry/wizard`:
Expand Down Expand Up @@ -62,18 +54,25 @@ If you're using Expo, [read our docs](/platforms/react-native/manual-setup/expo/

## Configure

To capture all errors, initialize the Sentry React Native SDK as soon as possible.
<OnboardingOptionButtons
options={[
'error-monitoring',
'performance',
'profiling',
]}
/>

To capture all errors, initialize the Sentry React Native SDK as soon as possible.

```javascript {filename:App.js} {"onboardingOptions": {"performance": "5-7", "profiling": "8-10"}}
```javascript {filename:App.js} {"onboardingOptions": {"performance": "5-9", "profiling": "10-12"}}
import * as Sentry from "@sentry/react-native";

Sentry.init({
dsn: "___PUBLIC_DSN___",
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
// We recommend adjusting this value in production.
// Learn more at
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
// https://docs.sentry.io/platforms/react-native/configuration/options/#traces-sample-rate
tracesSampleRate: 1.0,
// profilesSampleRate is relative to tracesSampleRate.
// Here, we'll capture profiles for 100% of transactions.
Expand Down
23 changes: 16 additions & 7 deletions docs/platforms/react-native/manual-setup/expo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,30 @@ pnpm add @sentry/react-native

### Intialize the SDK

<OnboardingOptionButtons
options={[
'error-monitoring',
'performance',
'profiling',
]}
/>

Import the `@sentry/react-native` package and call `init` with your DSN:

```javascript {tabTitle:App.js or app/_layout.js}
```javascript {tabTitle:App.js or app/_layout.js} {"onboardingOptions": {"performance": "6-10", "profiling": "11-13"}}
import { Text, View } from "react-native";
import * as Sentry from "@sentry/react-native";

Sentry.init({
dsn: "___DSN___",

// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for tracing.
// We recommend adjusting this value in production
dsn: "___PUBLIC_DSN___",
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
// We recommend adjusting this value in production.
// Learn more at
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
// https://docs.sentry.io/platforms/react-native/configuration/options/#traces-sample-rate
tracesSampleRate: 1.0,
// profilesSampleRate is relative to tracesSampleRate.
// Here, we'll capture profiles for 100% of transactions.
profilesSampleRate: 1.0,
});

function App() {
Expand Down
Loading