Creating our app's entry point
All React Native apps have one entry file: index.js
, we will delegate the root of the component's tree to our src/main.js
file:
/*** index.js ***/ import { AppRegistry } from 'react-native'; import App from './src/main'; AppRegistry.registerComponent('rssReader', () => App);
We will also register our app with the operating system.
Now, let's take a look at the src/main.js
file to understand how we will set up navigation and start up our component's tree:
/** * src/main.js ***/ import React from 'react'; import { StackNavigator } from 'react-navigation'; import FeedsList from './screens/FeedsList.js'; import FeedDetail from './screens/FeedDetail.js'; import EntryDetail from './screens/EntryDetail.js'; import AddFeed from './screens/AddFeed.js'; import store from './store'; const Navigator = StackNavigator({ FeedsList: { screen: FeedsList }, FeedDetail: { screen: FeedDetail }, EntryDetail: { screen: EntryDetail }, AddFeed: { screen: AddFeed }, }...