Pagination.js 509 Bytes
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import React, { useState, useEffect, useRef } from 'react';
import { Pagination } from 'react-bootstrap';

function pagination() {
    let active = 1;
    let items = [];
    for (let number = 1; number <= 5; number++) {
        items.push(
            <Pagination.Item key={number} active={number === active}>
                {number}
            </Pagination.Item>,
        );
    }

    return (
Kim, Subin's avatar
Kim, Subin committed
16
        <Pagination className="justify-content-center">{items}</Pagination>
Kim, Subin's avatar
Kim, Subin committed
17
18
19
20
    )
}

export default pagination