1 回答

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超10個(gè)贊
1、進(jìn)入你工程的根目錄
2、npm init (這個(gè)工作跟cocoapods的podfile文件初始化有點(diǎn)像)-> 根據(jù)提示輸入工程的package.json的內(nèi)容。
3、npm install
經(jīng)過上述的步驟之后工程根目錄底下就有了react-native的環(huán)境了。
然后此時(shí)要導(dǎo)入的redux框架,這時(shí)候只要往dependcies中增加:
"name": "RNIntergrationDemo",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "15.4.1",
"react-native": "0.39.2",
"redux":"3.6.0"
},
"devDependencies": {
"babel-jest": "18.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "18.1.0",
"react-test-renderer": "15.4.1"
},
"jest": {
"preset": "react-native"
}
(然后接著時(shí)通過cocoapods導(dǎo)入。。。)
- 1 回答
- 0 關(guān)注
- 3028 瀏覽
添加回答
舉報(bào)