Skip to content

onChange function on pagination component shouldn't be ejecuted on the firtst render. #72

@davs20

Description

@davs20

hello @estevanmaito , im using the pagination component and I discover that onChange funtion is ejecuted on the first render, that's wrong because, onChange function only should be ejecuted when the page is changed, so, I was thinking and I found a problem in the useEffect that handle this function, the problem is that useEffect always will be ejecuted on first render , even if you don't change the state, so my proposal is create a reference using useRef , with that , useEffect will know when the component is rendered for first time.

}, [activePage])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions