Skip to content

Commit 4262b8a

Browse files
committed
Merge branch 'probeadd-master'
2 parents 73cf087 + 6efca5d commit 4262b8a

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

docs/guides/Guide-Intro.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ react-native run-android # or:
2020
react-native run-ios
2121
```
2222

23+
If you are using `create-react-native-app` instead of `react-native init`, then:
24+
```sh
25+
# Create a new React Native App
26+
create-react-native-app SimpleApp
27+
cd SimpleApp
28+
29+
# Install the latest version of react-navigation from npm
30+
npm install --save react-navigation
31+
32+
# Run the new app
33+
npm start
34+
35+
# This will start a development server for you and print a QR code in your terminal.
36+
```
37+
2338
Verify that you can successfully see the bare sample app run on iOS and/or Android:
2439

2540
```phone-example
@@ -51,10 +66,11 @@ class HomeScreen extends React.Component {
5166
}
5267
}
5368

54-
const SimpleApp = StackNavigator({
69+
export default const SimpleApp = StackNavigator({
5570
Home: { screen: HomeScreen },
5671
});
5772

73+
// if you are using create-react-native-app you don't need this line
5874
AppRegistry.registerComponent('SimpleApp', () => SimpleApp);
5975
```
6076

@@ -110,7 +126,7 @@ class HomeScreen extends React.Component {
110126
We're using the navigate function from the [screen navigation prop](/docs/navigators/navigation-prop) to go to `ChatScreen`. But that won't work until we add this to our `StackNavigator` like so:
111127

112128
```js
113-
const SimpleApp = StackNavigator({
129+
export default const SimpleApp = StackNavigator({
114130
Home: { screen: HomeScreen },
115131
Chat: { screen: ChatScreen },
116132
});

docs/guides/Guide-Nested.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,15 @@ const SimpleApp = StackNavigator({
5353
Because `MainScreenNavigator` is being used as a screen, we can give it `navigationOptions`:
5454

5555
```js
56-
MainScreenNavigator.navigationOptions = {
57-
title: 'My Chats',
58-
};
56+
const SimpleApp = StackNavigator({
57+
Home: {
58+
screen: MainScreenNavigator,
59+
navigationOptions: {
60+
title: 'My Chats',
61+
},
62+
},
63+
Chat: { screen: ChatScreen },
64+
})
5965
```
6066

6167
Lets also add a button to each tab that links to a chat:

0 commit comments

Comments
 (0)