Skip to content

Commit 6f5db9a

Browse files
authored
docs(react-native): Update the docs in accordance to how the current structure of an Expo project looks like (#14545)
A relatively minor change: the current version of docs for Expo seems a bit outdated in a sense that it asks you to make a change to the project that doesn't match the actual project that's being generated by Expo. This PR fixes that and makes it a bit easier for newcomers to understand what changes need to be made.
1 parent 47eba75 commit 6f5db9a

File tree

1 file changed

+5
-9
lines changed
  • docs/platforms/react-native/manual-setup

1 file changed

+5
-9
lines changed

docs/platforms/react-native/manual-setup/expo.mdx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pnpm add @sentry/react-native
6767
Import the `@sentry/react-native` package and call `init` with your DSN:
6868

6969
```javascript {tabTitle:App.js or app/_layout.js}
70-
import { Text, View } from "react-native";
70+
import { Stack } from "expo-router";
7171
import * as Sentry from "@sentry/react-native";
7272

7373
Sentry.init({
@@ -89,23 +89,19 @@ Sentry.init({
8989
// ___PRODUCT_OPTION_END___ profiling
9090
});
9191

92-
function App() {
93-
return (
94-
<View>
95-
<Text>Expo Example!</Text>
96-
</View>
97-
);
92+
function RootLayout() {
93+
return <Stack />;
9894
}
9995

100-
export default Sentry.wrap(App);
96+
export default Sentry.wrap(RootLayout);
10197
```
10298

10399
### Wrap Your App
104100

105101
Wrap the root component of your application with `Sentry.wrap`:
106102

107103
```javascript {tabTitle:App.js or app/_layout.js}
108-
export default Sentry.wrap(App);
104+
export default Sentry.wrap(RootLayout);
109105
```
110106

111107
### Add the Sentry Expo Plugin

0 commit comments

Comments
 (0)