Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript React js tsx codesandbox问题引发了一个跨源错误,lodash.isequal_Javascript_Reactjs_Qr Code_Codesandbox - Fatal编程技术网

Javascript React js tsx codesandbox问题引发了一个跨源错误,lodash.isequal

Javascript React js tsx codesandbox问题引发了一个跨源错误,lodash.isequal,javascript,reactjs,qr-code,codesandbox,Javascript,Reactjs,Qr Code,Codesandbox,我尝试了一个模块的以下代码,但它给了我以下问题: 问题: 引发了一个跨原点错误。React没有访问的权限 开发中的实际错误对象。看见 …/react交叉原点错误以获取更多信息 问题: module“/sandbox/node_modules/@types/lodash.isequal/index”此模块 只能通过启用ECMAScript导入/导出来引用 “esModuleInterop”标志并引用其默认导出.ts(2497) 链接: 代码: import*作为“lodash.isEqual”中的

我尝试了一个模块的以下代码,但它给了我以下问题:

问题:

引发了一个跨原点错误。React没有访问的权限 开发中的实际错误对象。看见 …/react交叉原点错误以获取更多信息

问题:

module“/sandbox/node_modules/@types/lodash.isequal/index”此模块 只能通过启用ECMAScript导入/导出来引用 “esModuleInterop”标志并引用其默认导出.ts(2497)

链接:

代码:

import*作为“lodash.isEqual”中的isEqual;
从“qrcode generator”导入*作为qrGenerator;
从“React”导入*作为React;
从“react dom”导入*作为react dom;
导出接口IProps{
值?:字符串;
eLevel?:“L”|“M”|“Q”|“H”;
enableCORS?:布尔值;
大小?:数字;
quietZone?:数字;
bgColor?:字符串;
fgColor?:字符串;
logoImage?:字符串;
标识宽度?:编号;
标识高度?:编号;
logo不透明度?:数字;
qrStyle?:“正方形”|“点”;
风格?:对象;
}
导出类QRCode扩展React.Component{
私有画布:React.reObject;
公共静态defaultProps:IProps={
值:“https://reactjs.org/",
eLevel:“M”,
enableCORS:false,
尺寸:150,
quietZone:10,
bgColor:#FFFFFF“,
fgColor:#000000“,
不透明度:1,
风格:“正方形”
};
私有静态utf16to8(str:string):string{
放出:string=“”,
一:号码,,
c:数字;
const len:number=str.length;
对于(i=0;i=0x0001&&c 0x07ff){
out+=String.fromCharCode(0xe0 |((c>>12)和0x0f));
out+=String.fromCharCode(0x80 |((c>>6)和0x3f));
out+=String.fromCharCode(0x80 |((c>>0)和0x3f));
}否则{
out+=String.fromCharCode(0xc0 |((c>>6)和0x1f));
out+=String.fromCharCode(0x80 |((c>>0)和0x3f));
}
}
返回;
}
专用绘图定位模式(行、列、长度、ctx){
const cellSize=this.props.size/长度;

对于(让r=-1;r我在您的沙盒中只看到了交叉源抛出的错误。我在codesandbox中多次看到这种交叉源错误,我相信这是因为它在iframe中运行,据我所知是无害的

我认为使用默认导入将修复您的第二个错误,在您的沙箱中对我来说是这样

import isEqual from "lodash.isequal";

是否有我遗漏的其他错误/警告?在导入
lodash.isEqual
时,在您的沙箱中,就像我已经做的一样,linter警告消失了。除了跨原点错误,我看不到其他问题。
import isEqual from "lodash.isequal";