Skip to content

Commit

Permalink
Add snack links to hello-react-navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Dec 25, 2023
1 parent 8b3d5ef commit 7486e8b
Show file tree
Hide file tree
Showing 2 changed files with 263 additions and 72 deletions.
51 changes: 30 additions & 21 deletions versioned_docs/version-7.x/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,29 +78,37 @@ work on Android devices. Edit `MainActivity.kt` or `MainActivity.java` file whic
Add the highlighted code to the body of `MainActivity` class:

<Tabs>
<TabItem value='kotlin' label='Kotlin' default>
```kotlin {3-5}
class MainActivity: ReactActivity() {
// ...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(null)
}
// ...
}
```
<TabItem value='kotlin' label='Kotlin' default>

```kotlin
class MainActivity: ReactActivity() {
// ...
// highlight-start
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(null)
}
// highlight-end
// ...
}
```

</TabItem>
<TabItem value='java' label='Java'>
```java {3-6}
public class MainActivity extends ReactActivity {
// ...
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
// ...
}
```
</TabItem>

```java
public class MainActivity extends ReactActivity {
// ...
// highlight-start
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
// highlight-end
// ...
}
```

</TabItem>
</Tabs>

and make sure to add the following import statement at the top of this file below your package statement:
Expand Down Expand Up @@ -139,6 +147,7 @@ To get started with dynamic configuration, first, we need to wrap your app in `N

```js
import * as React from 'react';
// highlight-next-line
import { NavigationContainer } from '@react-navigation/native';

export default function App() {
Expand Down
Loading

0 comments on commit 7486e8b

Please sign in to comment.