现在我配置路由器:
<ReduxRouter>
<Route component={App}>
<Route path="/" component={Home} />
<Route path='path' component={pathComponent} />
</Route>
</ReduxRouter>
已经在组件中写道:
export default class pathComponent extends Component {
constructor (props) {
super(props)
}
componentDidMount () {
this.props.getData()
}
}
但是在愚蠢的组件中保留一些逻辑并不是那么好......