1.在src目录下定义一个containers文件夹存放容器组件
2.在containers文件夹下新建一个math容器组件
3.容器组件需要借助react-redux
4.安装react-redux
yarn add react-redux
5.引入UI组件
// 引入math(ui组件)import MathUI from '../../components/Math'
6.引入redux
需要在ui组件使用的时候在标签上引入
//引入import Math from './containers/math'//使用<Math store={store}/>
7.引入connect用于连接ui组件和redux
//引入connect用于连接ui组件和reduximport {connect} from 'react-redux'
8.使用connect创建并暴露组件
//高阶函数,连接ui组件//使用connect创建并暴露一个math组件export default connect()(MathUI)
