- 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
推薦閱讀
- Kubernetes修煉手冊
- Windows Server 2012 Hyper-V:Deploying the Hyper-V Enterprise Server Virtualization Platform
- Mobile-first Bootstrap
- Ansible權威指南
- 操作系統基礎與實踐:基于openEuler平臺
- Python基礎教程(第3版)
- Linux使用和管理指南:從云原生到可觀測性
- Kali Linux高級滲透測試(原書第3版)
- 統信UOS應用開發進階教程
- OpenVZ Essentials
- Java EE 7 Developer Handbook
- CSS揭秘
- Azure Resource Manager Templates Quick Start Guide
- Windows 8完全自學手冊
- Implementing Cloud Design Patterns for AWS(Second Edition)