Last active
September 5, 2019 17:24
-
-
Save daniilgri/74c447b590a9b422d941348a0a8fe3cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from "react"; | |
import { connect } from "react-redux"; | |
import Home from "../pages/Home"; | |
import { initForm } from "../store/forms/actions"; | |
import { FormsActionTypes } from "../store/forms/types"; | |
export interface HomePageContainerProps { | |
onInitForm: FormsActionTypes; | |
} | |
const HomePageContainer: React.SFC<HomePageContainerProps> = ({ | |
onInitForm | |
}) => { | |
useEffect(() => { | |
onInitForm(); | |
}, []); | |
return <Home />; | |
}; | |
const mapDispatchToProps = (dispatch: any) => { | |
return { | |
onInitForm: dispatch(initForm) | |
}; | |
}; | |
export default connect( | |
null, | |
mapDispatchToProps | |
)(HomePageContainer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment