Skip to content

Instantly share code, notes, and snippets.

View kapscudi's full-sized avatar
🏠
Working from home

KaPs CuDi kapscudi

🏠
Working from home
View GitHub Profile
@kapscudi
kapscudi / LatestPost.js
Created January 7, 2021 10:16 — forked from viswanathsaj/LatestPost.js
Implementation for a load more button in React/NextJS using Ghost CMS
// Make sure you are pulling ALL your posts from the ghost API [No limit]
function LatestPost (props) {
const [ postNum, setPostNum] = useState(3); // Default number of posts dislplayed
function handleClick() {
setPostNum(prevPostNum => prevPostNum + 3) // 3 is the number of posts you want to load per click
}