小编Aja*_*vek的帖子

React打字稿打字不起作用

通过打字安装后,我在终端中收到以下错误

终端错误

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)

javascript typescript reactjs webpack typescript-typings

14
推荐指数
2
解决办法
5743
查看次数

NPM 命令不起作用 - ENAMETOOLONG:名称太长,mkdir

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)

npm

5
推荐指数
1
解决办法
1537
查看次数

HTML5 Canvas使用getImageData和putImageData进行缩放

有没有办法使用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

html5 getimagedata html5-canvas putimagedata

2
推荐指数
1
解决办法
4245
查看次数