Skip to content

How to implement pre-loading and pagination? #394

@dtolstyi

Description

@dtolstyi

Hello,

I'm using your kit for a quite while but still I'm not sure about the idea how's it the best to implement pagination?

So, my idea is to show the list of the items to the user as soon as he opens a special page on the site.
This page should show page=1 for the first entry.
In addition, on this page, user got pagination, so he can navigate to page=2, e.g.

So far, I got react container component that uses static need = [] array to pre-load data for the first time when user accesses the page with URL: http://localhost:3000/aps e.g.
After the user presses the button of the pagination, he is redirected with <Link/> component of react-router to the URL: http://localhost:3000/aps?page=2 and redux action CHANGE_APS_PAGE is fired.

The problem is that whenever user is redirected to the page=2 the static need = [] is being re-executed again retrieving 1st page.

Looks like I'm misunderstanding something or static need is not a correct choice in this case.

I would like to hear your ideas what's the best way to implement pagination in my case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions