Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up
Find file
Copy path
refactoring-react-legacy-code/client/src/containers/Home/HomePage.js
Find file
Copy path
Fetching contributors…
| import React from "react"; | |
| import { connect } from "react-redux"; | |
| import { CourseList } from "../../components"; | |
| import { onGetCourses } from "../../store/actions"; | |
| class HomePage extends React.Component { | |
| componentDidMount() { | |
| this.props.loadCourses(); | |
| } | |
| render() { | |
| const { courses } = this.props; | |
| return <CourseList courses={courses} />; | |
| } | |
| } | |
| const mapStateToProps = state => ({ | |
| courses: state.courses | |
| }); | |
| const mapDispatchToProps = { | |
| loadCourses: onGetCourses | |
| }; | |
| export default connect( | |
| mapStateToProps, | |
| mapDispatchToProps | |
| )(HomePage); |