Skip to content

Commit

Permalink
#Provide intro for create-react-native-app and react-native init
Browse files Browse the repository at this point in the history
  • Loading branch information
probeadd committed Aug 12, 2017
1 parent cc22138 commit d95f01f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
16 changes: 16 additions & 0 deletions docs/guides/Guide-Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ react-native run-android # or:
react-native run-ios
```

If you are using `create-react-native-app` instead of `react-native init`, then:
```sh
# Create a new React Native App
create-react-native-app SimpleApp
cd SimpleApp

# Install the latest version of react-navigation from npm
npm install --save react-navigation

# Run the new app
npm start

#This will start a development server for you, and print a QR code in your terminal.
```

Verify that you can successfully see the bare sample app run on iOS and/or Android:

```phone-example
Expand Down Expand Up @@ -55,6 +70,7 @@ const SimpleApp = StackNavigator({
Home: { screen: HomeScreen },
});

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

Expand Down
12 changes: 9 additions & 3 deletions docs/guides/Guide-Nested.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@ const SimpleApp = StackNavigator({
Because `MainScreenNavigator` is being used as a screen, we can give it `navigationOptions`:

```js
MainScreenNavigator.navigationOptions = {
title: 'My Chats',
};
const SimpleApp = StackNavigator({
Home: {
screen: MainScreenNavigator,
navigationOptions: {
title: 'My Chats',
},
},
Chat: { screen: ChatScreen },
})
```

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

0 comments on commit d95f01f

Please sign in to comment.