草庐IT

mongodb-native

全部标签

javascript - React Native 上的背景图片和 ScrollView

我正在使用ReactNative构建一个应用程序,并希望获得一个背景图像和一个覆盖在背景图像之上的ScrollView,例如雅虎天气应用程序。但我无法让它工作。请帮忙。 最佳答案 要得到这个效果,你需要设置一个绝对定位的图片,然后在View上面放一个ScrollView:'usestrict';varReact=require('react-native');var{AppRegistry,StyleSheet,Text,View,Dimensions,ScrollView,Image}=React;letwidth=Dimensi

javascript - React Native AsyncStorage getItem 返回 promise 而不是值(value)

我有一个登录表单,我可以发布表单值。成功的POST请求后,我获得了从API返回的身份验证token。我需要将此token保存在本地存储中以备将来引用。为了保存这个授权token,我使用了AsyncStorage。我使用AsyncStorage.setItem(STORAGE_KEY,responseData.auth_token);setItem方法来保存数据。如果我通过console记录这个:console.log(AsyncStorage.setItem(STORAGE_KEY));它像这样作为promise对象返回Promise{_45:0,_81:0,_65:null,_54:

javascript - 如何观察 react-native node_modules 的变化

当我运行react-nativestart或npmstart时,打包程序启动并提示LookingforJSfilesin/Users/map/repos/myrepo/我启用了热重载。当我更改位于/Users/map/repos/myrepo/node_modules/react-native/中的文件时,似乎检测到更改,但是如果我在第三方存储库中编辑文件,如/Users/map/repos/myrepo/node_modules/react-native-menu/看起来watchman没有检测到变化。我刚刚将项目中的ReactNative升级到0.39,我认为这不是以前的默认行为。

Helm部署minio\nginx\mongodb\elasticsearch

minioappVersion:2022-06-25chartVersion:11.7.7一、独立模式auth:auth:rootPassword:"12345678rtt"#密码长度需>=8位rootUser:"root"mode:standalone#默认为单机模式persistence:storageClass:minio-data#存储类,必填size:8Giservice:type:NodePort#暴露端口port:9000nodePort:31311二、分布式模式auth:auth:rootPassword:"12345678rtt"#密码长度需>=8位rootUser:"roo

javascript - React Native Expo build 非常缓慢

我最近注意到我的构建时间显着增加,有时需要整整一分钟才能加载。在控制台上,我仍然相当快地看到“BuildingJavaScriptbundle:finished”,但屏幕刷新时间要长得多。有没有理由会发生这样的事情? 最佳答案 尝试在您的开发机器上的模拟器中使用Expo,并确定它花费的时间是否与您的设备一样长:如果它比您的测试设备更快,那么您应该检查测试设备上的网络连接如果它和测试设备一样慢,那么您可以尝试删除node_modules并使用“npminstall”或“yarn”重新安装它们。Expo将与所有其他包一起重新下载。

javascript - 在 React/React Native 中使用构造函数与 state = {} 有什么区别?

这个问题在这里已经有了答案:Whatisthedifferencebetweenusingconstructorvsstate={}todeclarestateinreactcomponent?(3个答案)关闭4年前。我都看过exportdefaultclassLoginScreenextendsReact.Component{constructor(props){super(props);this.state={loading:false,loggedIn:false,}}}和exportdefaultclassLoginScreenextendsReact.Component{st

javascript - react native : @providesModule declaration with the same name across two different files

我们有两个repos,它们都有react-native作为依赖项;一个是实际的RN应用程序,另一个是UI包,其中包含许多自定义的react-native组件。当我使用RN应用程序符号链接(symboliclink)(使用npm链接)UI包并尝试启动js服务器时,它抛出以下错误:此错误是由两个不同文件中具有相同名称的@providesModule声明引起的。这似乎是因为它在UI包的react-native副本中获取相同的RN文件。我知道watchman不使用符号链接(symboliclink)存在问题,但我认为这是不同的-与有两个react-native模块有关。请问有人知道解决这个问题

javascript - react native 绑定(bind)动画事件

需要一些JS方面的帮助。是否可以根据需要绑定(bind)动画事件?我需要这样做:onScroll={Animated.event([{nativeEvent:{contentOffset:{y:this.state.animTop}}}])}我也需要这样做onScroll={(e)=>{letpositionY=e.nativeEvent.contentOffset.y;this._handleScroll(positionY);this.setState({y:positionY})}}我试过像这样绑定(bind)两者,但它不需要执行Animated.eventcomponentDi

javascript - jQuery 与 native 原型(prototype)冲突

我在将jQuery与nativeJavaScript(不是prototype.js)结合使用时遇到问题。使用以下代码时,jQuery1.9.1会出现错误消息:Object.prototype.myVeryGreatFunction=function(){//...}[Error]TypeError:undefinedisnotafunction(evaluating'U[a].exec(s)')ft(jquery.min.js,line4)wt(jquery.min.js,line4)st(jquery.min.js,line4)find(jquery.min.js,line4)ini

javascript - react native : ListView not displaying all rows

我试图在ReactNativeListView中显示行列表,但它只显示适合单个屏幕的条目,即我无法向下滚动以查看更多行。样式如下:styles=StyleSheet.create({container:{flex:1,marginTop:60},rowContainer:{flexDirection:'row',justifyContent:'space-around'}})ListView:return({this.getHeader()})行:return({text})我做错了什么? 最佳答案 我有同样的问题,发现外面有包装V