我想使用https://github.com/umhan35/react-native-search-bar的原生IOS搜索栏,当我运行npm install --save(http://facebook.github.io/react-native/docs/linking-libraries-ios.html)时,出现错误bash:library-with-native-dependencies:没有这样的文件或目录。我试图手动链接库,但它没有显示任何错误失败。有人可以帮忙吗?React原生链接库
1
A
回答
0
我希望你没有输入
npm install <library-with-native-dependencies> --save
-bash: library-with-native-dependencies: No such file or directory
在你做的情况下,它应该是
npm install react-native-search-bar --save
如果你设法手动将其链接并运行它,可以尝试设置宽度和高度for SearchBar
.........
render(){
return (<SearchBar style={styles.searchBar} ref='searchBar' placeholder='Search'/>);
}
.........
const styles = StyleSheet.create({
searchBar:{
width: 200,
height: 40
}
});
0
检查模块是否存在于ProjectDirectory - > node_modules - >反应本地搜索酒吧
如果不按照以下步骤
从根目录打开的package.json
更新您的依赖关系
例如:从Github获取。
"dependencies": {
"react": "^0.14.8",
"react-native": "^0.25.1",
"react-native-search-bar": "git+https://github.com/umhan35/react-native-search-bar",
}
OR
例:取从NPM
"dependencies": {
"react": "^0.14.8",
"react-native": "^0.25.1",
"react-native-search-bar": “^2.11.0",
}
从终端切换到您的项目目录。
npm install
npm start
react-native run-ios
那么无论你想用它你可以导入此模块。
例如:在index.ios.js
var awesomeSearchBar = require('react-native-search-bar’);
相关问题
- 1. React原生ping
- 2. React原生深度链接从其他应用程序
- 3. React原生调试
- 4. React原生属性
- 5. React原生导航
- 6. React + React原生入门套件
- 7. React原生资产配置
- 8. 了解Javascript和React原生
- 9. React原生图像上传
- 10. NavigatorIOS React原生半透明
- 11. React原生形式ref空
- 12. React原生固定页脚
- 13. React原生等价物React.createElement
- 14. React原生文本区域
- 15. React原生插入变量
- 16. 反应原生如何链接官方库(如CameraRoll)?
- 17. 链接跨平台库原生的Android应用程序
- 18. Xamarin原生链接失败Paypal
- 19. 将libpng链接到android原生项目
- 20. 原生链接失败,重复符号
- 21. 动态链接库的工作原理
- 22. 如何使用airbnb/react-native-maps将原始地图中的标记链接到原生地图?
- 23. React-Native的本机端请求来自React的信息? (桥接/原生模块)
- 24. React-Router外部链接
- 25. React原生Android抓取失败,连接到本地API
- 26. React原生背景视频未显示
- 27. React原生单元测试与AVA
- 28. React原生WebView加载错误处理
- 29. React原生WebView刷新状态
- 30. clustr react-native-maps反应原生地图
我尝试手动连接是很好,但它不工作。现在我得到错误未处理JS异常:未定义不是一个对象(评估'NativeModules.RNSearchBarManager.ComponentHeight')。我很抱歉,我是新来的本地人,并得到很多错误 – Dave
你可以粘贴你的代码或分享它的地方? –
嘿谢谢你。我已经手动链接和使用斜坡,它是confused.I删除手动安装并再次运行命令,它现在正在工作 – Dave