端口被占用了,把占用3000端口的应用关了再启动
基于webpack + react + react-router + redux + less + flex.css + ES6 的React版cnode社区
Signin.jsx里面的
export default connect((state) => { return { User: state.User }; }, action(‘User’))(Main);
这儿的action(‘User’)是什么意思?怎么没有dispatch呢?
import getComponent from ‘…/components/utils/getComponent’
const routes = [
{
path: ‘/login’,
component: (props) => getComponent(props, () => import(’…/components/Login/index’))
},
{
path: ‘/register’,
component: (props) => getComponent(props, () => import(’…/components/Register/index’))
},
{
path: ‘/menu’,
component: (props) => getComponent(props, () => import(’…/components/Menu/index’)),
routes: [
{
path: ‘/menu/dash1’,
component: (props) => getComponent(props, () => import(’…/components/Dash/dash1’))
},
{
path: ‘/menu/dash2’,
component: (props) => getComponent(props, () => import(’…/components/Dash/dash2’))
}
]
}
];
export default routes;
npm WARN deprecated autoprefixer-loader@3.2.0: Please use postcss-loader instead of autoprefixer-loader
[mapDispatchToProps(dispatch, [ownProps]): dispatchProps] (Object or Function): 如果传递的是一个对象,那么每个定义在该对象的函数都将被当作 Redux action creator,而且这个对象会与 Redux store 绑定在一起,其中所定义的方法名将作为属性名,合并到组件的 props 中。