Skip to content

Instantly share code, notes, and snippets.

@techomoro
Created Oct 6, 2021
Embed
What would you like to do?
// pages/Home.js
import { Container } from "react-bootstrap";
import Posts from "../components/Posts";
import { useEffect } from "react";
import { useDispatch } from "react-redux";
import { getPosts } from "../store/posts/actions";
export default function Home() {
let dispatch = useDispatch();
useEffect(() => {
dispatch(getPosts());
}, []);
return (
<Container className="home">
<Posts />
</Container>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment