官术网_书友最值得收藏!

Adding dependencies

For this project, we will use several npm modules to save development time and put the focus on the functional aspects of the RSS reader itself, rather than dealing with custom state management frameworks, custom UI, or data processing. For these matters, we will use the following package.json file:

{  
"name":"rssReader",
"version":"0.0.1",
"private":true,
"scripts":{
"start":"node node_modules/react-native/local-cli/cli.js start",
"test":"jest"
},
"dependencies":{
"mobx":"^3.1.9",
"mobx-react":"^4.1.8",
"native-base":"^2.1.3",
"react":"16.0.0-beta.5",
"react-native": "0.49.3",
"react-native-vector-icons":"^4.1.1",
"react-navigation":"^1.0.0-beta.9",
"simple-xml2json":"^1.2.3"
},
"devDependencies":{
"babel-jest":"20.0.0",
"babel-plugin-transform-decorators-legacy":"^1.3.4",
"babel-preset-react-native":"1.9.1",
"babel-preset-react-native-stage-0":"^1.0.1",
"jest":"20.0.0",
"react-test-renderer":"16.0.0-alpha.6"
},
"jest":{
"preset":"react-native"
}
}

As can be seen in this file, we will be using the following npm modules together with the standard React Native's modules:

  • mobx: This is the state management library we will be using 
  • mobx-react: This is the official React bindings for MobX
  • native-base: As we did in the previous chapter, we will use NativeBase's UI library
  • react-native-vector-icons: NativeBase requires this module to display graphic icons
  • react-navigation: We will use the React Native's community navigation library again
  • simple-xml2json: A lightweight library to convert XML (the standard format for RSS feeds) into JSON to easily manage the RSS data within our code

Having this package.json file, we can run the following command (in the root folder of our project) to finish the installation:

npm install

Once npm finishes installing all dependencies, we can start our app in the iOS simulator:

react-native run-ios

Or in the Android emulator:

react-native run-android
主站蜘蛛池模板: 楚雄市| 嘉禾县| 安福县| 玉门市| 乾安县| 马公市| 海丰县| 湖北省| 界首市| 鄂托克旗| 九台市| 高邑县| 岳普湖县| 游戏| 陆丰市| 义乌市| 玉溪市| 阜城县| 云梦县| 沧州市| 八宿县| 通榆县| 仪陇县| 四子王旗| 商丘市| 岐山县| 视频| 海宁市| 东安县| 康保县| 化德县| 枣庄市| 定陶县| 湖南省| 瑞安市| 抚顺市| 越西县| 白朗县| 监利县| 彰武县| 涞源县|