๋ชฉ๋กopenapi (1)
๐ค ์์งlog ๐ค
[REACT] Pagination ๊ตฌํํ๊ธฐ
// Main.tsx import { useEffect, useState } from "react"; import styled from "styled-components"; import { useQuery } from "react-query"; import Pagination from "../templates/Pagination"; const Main = () => { // const [post, setPost] = useState([]); const [totalPosts, setTotalPosts] = useState(10); // ํ์ด์ง ๋น ๊ฒ์๋ฌผ ์ const [page, setPage] = useState(1); // ํ์ฌ ํ์ด์ง ๋ฒํธ const offset = (page - 1) * totalP..
๐ React
2023. 8. 24. 16:18