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

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
主站蜘蛛池模板: 新营市| 清流县| 孝感市| 芦溪县| 黑水县| 右玉县| 错那县| 集贤县| 凤山县| 平安县| 汾西县| 竹溪县| 秦安县| 阿图什市| 凌源市| 奉新县| 德保县| 寿阳县| 阿拉善盟| 三河市| 竹溪县| 长岛县| 竹山县| 江源县| 阜新| 东乡| 萨嘎县| 黎平县| 和平县| 原阳县| 长岭县| 浦北县| 光山县| 出国| 全州县| 广南县| 正阳县| 亳州市| 鲁甸县| 九台市| 贵州省|