通过打字安装后,我在终端中收到以下错误
终端错误
error TS2320: Interface 'Element' cannot simultaneously extend types 'ReactElement<any>' and 'ReactElement<any>'.
Named property 'type' of types 'ReactElement<any>' and 'ReactElement<any>' are not identical.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/typings/globals/react/index.d.ts
(2375,5): error TS1036: Statements are not allowed in ambient contexts.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/typings/globals/react-dom/index.d.ts
(69,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/node_modules/@types/react-dom/index.d.ts
(19,31): error TS2315: Type 'DOMAttributes' is not generic.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/node_modules/@types/react-dom/index.d.ts
(44,60): error TS2315: Type 'DOMAttributes' is not generic.
ERROR in …Run Code Online (Sandbox Code Playgroud) npm 命令突然停止工作。不确定我做错了什么。尝试重新安装还是失败
USBLRAVIVEKMB3:teach avivek$ npm
Error: ENAMETOOLONG: name too long, mkdir '/Users/avivek/Dev/Node/Experiments/teach/(node:4125) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:4125) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:4125) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a …Run Code Online (Sandbox Code Playgroud) 有没有办法使用getImageData和putImageData来缩放画布.Below是代码片段.
var c=document.getElementById("myCanvas");
var c2=document.getElementById("myCanvas2");
var ctx=c.getContext("2d");
var ctx2=c2.getContext("2d");
ctx.fillStyle="red";
ctx.fillRect(10,10,50,50);
function copy(){
var imgData=ctx.getImageData(10,10,50,50);
ctx2.translate(133.333,0);
ctx2.scale(0.75,1);
ctx2.putImageData(imgData,10,70);
}
我试过这个http://jsbin.com/efixur/1/edit.
谢谢Ajain
getimagedata ×1
html5 ×1
html5-canvas ×1
javascript ×1
npm ×1
putimagedata ×1
reactjs ×1
typescript ×1
webpack ×1