草庐IT

native-methods

全部标签

javascript - this.state 在 react native 的 onPress 事件期间未定义

你好,我是ReactNative的新手,我的代码是:importReact,{View,Text,TextInput,Component}from'react-native';importStylefrom'./styles/signin';importButtonfrom'../common/button';exportdefaultclassSignInextendsComponent{constructor(props){super(props);this.state={email:'',password:''};}render(){return(Emailthis.setSta

javascript - jQuery-UI draggable error 'cannot call methods prior to init' , 在更新到版本 1.10.1

我在使用jQuery-UI1.8.2时可以正常使用可拖动插件,然后我更改为1.10.1。我发现的主要区别是在启用和禁用插件时,我不再需要使用:$this.draggable('option','disabled',true);但可以简单地使用$this.draggable('disable');但后来我意识到还有另一个问题。我得到这个错误,它弄乱了我的整个程序,我不知道如何修复它:Error:cannotcallmethodsondraggablepriortoinitialization;attemptedtocallmethod'enable'为了修复它,我确保在任何进一步的选项之

javascript - Access-Control-Allow-Methods 不允许删除

我正在尝试使用jQuery从Chrome发送跨域DELETE请求。但是,开发者控制台中记录了以下错误消息,这失败了:XMLHttpRequestcannotloadhttp://actual/url/here.MethodDELETEisnotallowedbyAccess-Control-Allow-Methods.javascript代码在本地主机上运行,​​如下所示:$.ajax({type:"DELETE",url:"http://actual/url/here",xhrFields:{withCredentials:true}});这会导致发送像这样的飞行前请求:OPTION

javascript - jQuery 用户界面 - 错误 : cannot call methods on dialog prior to initialization; attempted to call method 'open'

这个问题在这里已经有了答案:jqueryuiDialog:cannotcallmethodsondialogpriortoinitialization(11个答案)关闭6年前。[已解决]我写这个脚本。不幸的是,jQuery控制台抛出:Error:cannotcallmethodsondialogpriortoinitialization;attemptedtocallmethod'open'我使用jQuery1.10.2和jQueryUI1.10.4。$(function(){$("#player").on('click','img',function(){varzadanie=$("

javascript - React Native Expo 找不到变量自身

我在expo中创建新项目时突然遇到此错误,当我创建任何项目时它都能完美加载并且可以看到默认屏幕。当我尝试安装任何依赖项时,例如yarnaddnative-base它停止工作并给我无法找到变量Self和Expo被绞死请帮忙提前谢谢 最佳答案 对于使用expo-cli或XDE创建新项目的用户,您将在第一次“yarn”或“npminstall”后出现红屏“Can'tFindVariableSelf”。这是因为昨天发布了新的“whatwg-fetch”3.0.0(https://www.npmjs.com/package/whatwg-fe

javascript - 在 Chrome 中使用 React Native 调试 ES6 import 语句

我严重依赖ReactNative的“在Chrome中调试”功能,因此依赖Chrome的调试器。但是我注意到这个系统有一个巨大的缺陷:我使用ES6-styleimport导入的模块。即使代码执行正常,在Chrome的范围内也不可见。这使得使用这些导入语句调试代码变得非常困难。如果我用varMyModule=require(...)替换import语句,那么该模块在范围内可见。看完ES6moduleimportisnotdefinedduringdebugger我查看了ReactNative生成​​的转译源代码(通过在我的浏览器中加载http://localhost:8081/index.

javascript - 如何热重载包装在 native 导入上下文中的模块?

我在文件@/lang/index.js中有以下功能:asyncfunctionfetchMessages(locale){constmodule=awaitimport(/*webpackChunkName:"lang/[request]",webpackExclude:/index/*/`@/lang/${locale}`)returnmodule.default}我想热重载此函数导入的模块。我尝试了几种不同的module.hot.accept()变体,但没有成功。这是我在同一个文件末尾的热重载代码,但它不起作用:if(process.env.NODE_ENV!=="producti

javascript - React-Native/Redux dispatch 在 Action 中多次触发

我正在制作一个React/Redux应用程序。在我的一个操作中,dispatch在没有明显原因的情况下被调用时会触发6-8次。请参阅下面我的组件的操作文件中的addMarkersRequestAddress:exportfunctionaddMarkersSuccess(response){return{type:'addMarkersSuccess',status:'success',response:response,receivedAt:Date.now(),};}exportfunctionaddMarkersFailure(error){return{type:'addMar

javascript - react native : How to do a "shared element/zoom" transition using navigator?

是否可以像this那样进行“共享元素/缩放”转换?在使用导航器reactnative?特别适用于图片库/模式之类的东西。https://github.com/codepath/android_guides/wiki/Shared-Element-Activity-Transition 最佳答案 “目前React不支持在组件层次结构的不同部分重用原生View,这使得在纯JS中实现共享元素转换变得困难。”查看以下链接:https://github.com/brentvatne/hard-react-native-problems/iss

javascript - 在 Visual Studio Code 中自动导入以进行 React-Native 开发

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。关闭去年。Improvethisquestion是否有VSCode的扩展可以自动导入ReactNative组件?例如:当我输入时,然后它会自动建议import{View}from'react-native';