Skip to content

Instantly share code, notes, and snippets.

View ogorei's full-sized avatar
🤖
Work Hard Play Hard

reina_codes ogorei

🤖
Work Hard Play Hard
View GitHub Profile
@ogorei
ogorei / App.jsx
Created May 24, 2021 15:33 — forked from onedebos/App.jsx
How to implement a load more button in React
import React, { useState, useEffect } from "react";
import Posts from "./Posts";
import posts from "./postsArray";
const postsPerPage = 3;
let arrayForHoldingPosts = [];
const App = () => {
const [postsToShow, setPostsToShow] = useState([]);
const [next, setNext] = useState(3);