1.引入React和React-Native的時(shí)候要注意React-Native對(duì)React是有版本要求的彻秆,版本不合適會(huì)在npm install完成后看到一個(gè)版本問(wèn)題的warn。這時(shí)候刪除node_modules重新安裝浩淘。實(shí)驗(yàn)出目前可用最新的package.json為:
{
"name": "your name",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "15.4.1",
"react-native": "0.42.3"
}
}
- React-Native通過(guò)pod引入到現(xiàn)有項(xiàng)目出現(xiàn)如下錯(cuò)誤: