Commit 36d3f395 authored by afc163's avatar afc163

upgrade to React 16

parent 82d5b5dd
import dva from 'dva';
import 'moment/locale/zh-cn';
import models from './models';
import './polyfill';
import './g2';
// import { browserHistory } from 'dva/router';
import './index.less';
......
import 'core-js/es6/map';
import 'core-js/es6/set';
global.requestAnimationFrame =
global.requestAnimationFrame || function requestAnimationFrame(callback) {
setTimeout(callback, 0);
};
import React from 'react';
import React, { PureComponent } from 'react';
import { Card, Button, Form, Icon, Col, Row, DatePicker, TimePicker, Input, Select, Popover } from 'antd';
import { connect } from 'dva';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
......@@ -41,7 +41,9 @@ const tableData = [{
department: 'Sidney No. 1 Lake Park',
}];
function AdvancedForm({ form, dispatch, submitting }) {
class AdvancedForm extends PureComponent {
render() {
const { form, dispatch, submitting } = this.props;
const { getFieldDecorator, validateFieldsAndScroll, getFieldsError } = form;
const validate = () => {
validateFieldsAndScroll((error, values) => {
......@@ -263,6 +265,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
</FooterToolbar>
</PageHeaderLayout>
);
}
}
export default connect(state => ({
......
/* eslint-disable import/first */
import '../src/polyfill';
import { jsdom } from 'jsdom';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-15';
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({ adapter: new Adapter() });
......@@ -9,7 +11,3 @@ const documentHTML = '<!doctype html><html><body><div id="root"></div></body></h
global.document = jsdom(documentHTML);
global.window = document.defaultView;
global.navigator = global.window.navigator;
global.requestAnimationFrame = global.requestAnimationFrame || function requestAnimationFrame(cb) {
return setTimeout(cb, 0);
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment