- React Native Blueprints
- Emilio Rodriguez Martinez
- 235字
- 2021-07-02 15:20:02
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
推薦閱讀
- Mobile-first Bootstrap
- Instant Handlebars.js
- 操作系統基礎與實踐:基于openEuler平臺
- Extending Bootstrap
- 混沌工程實戰:手把手教你實現系統穩定性
- 深入淺出Node.js
- RHCSARHCE 紅帽Linux認證學習指南(第7版)EX200 & EX300
- Linux操作系統
- Linux內核API完全參考手冊(第2版)
- OpenVZ Essentials
- Zabbix監控系統之深度解析和實踐
- 完美應用Ubuntu(第2版)
- BuddyPress Theme Development
- openEuler操作系統核心技術與行業應用實踐
- Serverless Architectures with Kubernetes