![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
swpu_lwf
前端爱好者
展开
-
学习React前ES5、ES6知识准备
1、map filter reduce var arr=[1,2,3]; var arr1=arr.map(function(item,index,arr){ return item*2; }) console.log(arr1); var arr2=arr.map(item=>item*2); console.log(arr2); var arr3=arr.filter((it...原创 2018-05-01 11:53:12 · 444 阅读 · 0 评论 -
react+webpack项目基本配置
1、npm-init 生成package.json文件 2、安装项目依赖 npm intsall --save-dev react react-dom webpack webpack-cli npm install --save-dev webpack-dev-server npm install --save-dev babel-core babel-loader babel-preset...原创 2018-04-27 17:33:37 · 720 阅读 · 0 评论 -
TypeError:(0 ,jsdom.jsdom) is not a function
在使用Enzyme测试容器组件时,为了能使用mount方法递归渲染出所有DOM,不得不使用JSDOM在Node.js中模拟一个类似浏览器的环境。于是有了下面代码: import { jsdom } from 'jsdom'; global.document = jsdom('<!doctype html><html><body></body&a原创 2018-05-14 17:07:54 · 2891 阅读 · 0 评论 -
TypeError: expect.createSpy is not a function
在使用Expect进行测试过程中,遇到TypeError: expect.createSpy is not a function 该问题,那是因为: This package has been donated to Jest. This means that all future development of expect v21+ will take place at facebook/...原创 2018-05-14 21:01:49 · 549 阅读 · 0 评论