ReactNative 常见问题

ReactNative 

1.#import file not exist

解决办法:

在pods subspecs里面添加'BatchedBridge'

pod 'React', :path => './node_modules/react-native', :subspecs => [


'Core',

'RCTText',

'RCTNetwork',

'RCTWebSocket', # 这个模块是用于调试功能的

'BatchedBridge',# 加上这个

# 在这里继续添加你所需要的模块

]

2.unable to resolve module 'react-navigation' from ....


解决方法:在package.json 的"dependencies"加入"react-navigation":"git+https://github.com/react-community/react-navigation.git#7edd9a7"

如下:

"dependencies": {

"react": "16.0.0-alpha.12",

"react-native": "0.45.1",

"react-navigation":"git+https://github.com/react-community/react-navigation.git#7edd9a7"

},

然后执行安装命令

yarn add react-navigation或者是npm install --save react-navigation

执行后的"dependencies"如下:

"dependencies": {

"react": "16.0.0-alpha.12",

"react-native": "0.45.1",

"react-navigation": "^1.0.0-beta.11"

},

如果集成在现有工程里 还需要pod install

你可能感兴趣的:(ReactNative 常见问题)