Skip to content

Instantly share code, notes, and snippets.

@daniilgri
Last active September 5, 2019 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniilgri/74c447b590a9b422d941348a0a8fe3cf to your computer and use it in GitHub Desktop.
Save daniilgri/74c447b590a9b422d941348a0a8fe3cf to your computer and use it in GitHub Desktop.
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