---
title: "Discussion on \"Handling pagination with UseReducer\" | Hashnode"
description: "Discussion on \"Handling pagination with UseReducer\". Using useState to manage complex states in Pagination makes your code unclean. I'll demonstrate how to optimize it with useReducer."
url: "https://hashnode.com/posts/handling-pagination-with-usereducer/6352de4a9b8e1cc8a0ee0d5a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Handling pagination with UseReducer](https://greyhaired.dev/handling-pagination-with-usereducer?utm_source=hashnode&utm_medium=feed)

Using useState to manage complex states in Pagination makes your code unclean. I'll demonstrate how to optimize it with useReducer.

Oct 21, 2022 · 12 min read · greyhaired.dev  
Updated Oct 27, 2022  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#react-hooks](https://hashnode.com/tag/react-hooks)
-   [#usereducer](https://hashnode.com/tag/usereducer)
-   [#pagination](https://hashnode.com/tag/pagination)

## Written by

[victor ogbonna](https://hashnode.com/@greyhaired)

@greyhaired · Rivers, Nigeria

  
[View profile](https://hashnode.com/@greyhaired)

A Full Stack Developer at work; A Tech Enthusiast at heart

I am a front-end developer at work; I am a tech enthusiast at heart.

## Responses 2

Markdown supported · ⌘↵ to post

[Chris Miracle](https://hashnode.com/@chrismiracle)

[Oct 30, 2022](https://hashnode.com/posts/handling-pagination-with-usereducer/6352de4a9b8e1cc8a0ee0d5a/comment/635e164f79c5fd3f72f4019f)

Very detailed documentation

[victor ogbonna](https://hashnode.com/@greyhaired)

[Oct 30, 2022](https://hashnode.com/posts/handling-pagination-with-usereducer/6352de4a9b8e1cc8a0ee0d5a/comment/635e164f79c5fd3f72f4019f#reply-635ea37279c5fd3f72f40b51)

Thanks bro

[George, B. Smith](https://hashnode.com/@georgewhyte)

[Oct 22, 2022](https://hashnode.com/posts/handling-pagination-with-usereducer/6352de4a9b8e1cc8a0ee0d5a/comment/63539bc29b8e1cc8a0ee188f)

Lovely one , sir

[victor ogbonna](https://hashnode.com/@greyhaired)

[Oct 22, 2022](https://hashnode.com/posts/handling-pagination-with-usereducer/6352de4a9b8e1cc8a0ee0d5a/comment/63539bc29b8e1cc8a0ee188f#reply-63539d9dee1517c87af60a9e)

Thanks boss
