React-hook,组件基础模板

770 阅读1分钟
import React, { useEffect, uesState } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import {
  Table
} from 'antd';
import { defectListSelect } from '~/redux/reducer/defect/selector';
import { getFormattedMsg } from '~/i18n';

const DefectList = ({
  list
}) => {
  return (
    <Table
      rowKey={record => record.id}
      dataSource={list}
      filterMultiple={false}
      pagination={false}
    />
  );
};

DefectList.propTypes = {
  list: PropTypes.array
};

const mapStateToProps = state => ({
  list: defectListSelect(state)
});

export default connect()(DefectList);

-otway