我想使用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 + React原生入门套件
- 5. React原生文本区域
- 6. React原生图像上传
- 7. NavigatorIOS React原生半透明
- 8. React原生固定页脚
- 9. 了解Javascript和React原生
- 10. React原生资产配置
- 11. React原生插入变量
- 12. 反应原生如何链接官方库(如CameraRoll)?
- 13. 原生链接失败,重复符号
- 14. Xamarin原生链接失败Paypal
- 15. React-Native的本机端请求来自React的信息? (桥接/原生模块)
- 16. React原生Android抓取失败,连接到本地API
- 17. UnsatisfiedLinkError - 原生库 - jnidispatch.dll
- 18. React原生提取,意外令牌
- 19. React Native:原生模块不返回
- 20. React原生背景视频未显示
- 21. React原生检测屏幕旋转
- 22. React原生网络JSON响应
- 23. React原生FCM不能正常工作
- 24. React Native中的原生广告
- 25. 无法加载React原生图标
- 26. React原生WebView内容不能调整
- 27. React原生WebView刷新状态
- 28. React原生无穷视图寻呼机
- 29. 动态需要React原生图像
- 30. React原生提取不是函数
我尝试手动连接是很好,但它不工作。现在我得到错误未处理JS异常:未定义不是一个对象(评估'NativeModules.RNSearchBarManager.ComponentHeight')。我很抱歉,我是新来的本地人,并得到很多错误 – Dave
你可以粘贴你的代码或分享它的地方? –
嘿谢谢你。我已经手动链接和使用斜坡,它是confused.I删除手动安装并再次运行命令,它现在正在工作 – Dave