不用connect 就没有问题
import React from 'react';
import styles from './index.less';
import { history } from 'umi';
import { connect } from 'umi';
import { Modal, Input, Select } from 'antd';
import { Typography, Divider } from 'antd';
const { Title, Paragraph, Text } = Typography;
// 获取state
const mapStateToProps = (state:any) => {
const Modelwebgui = state['Modelwebgui'];
return {
Modelwebgui,
};
};
// 发送行为
const mapDispatchToProps = (dispatch:any) => {
return {
headerSwitch: (payload:any) => {
const action = {
type: `${'Modelwebgui'}/headerSwitch`,
payload: payload,
};
dispatch(action);
},
};
};
class BasicLayout extends React.Component {
state = {
inputs:123
};
//组件响应函数
render() {
return (
<div>
<Title id='概述' level={2}>概述</Title>
</div >
);
}
}
export default connect(mapStateToProps, mapDispatchToProps)(BasicLayout);
// export default BasicLayout;