Skip to content

theboxer/pagination-example

Repository files navigation

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

Steps to reproduce

  • Delete any item on first page, the card will disappear
  • Hit Load More and delete the item from the newly loaded page, the card will stay in the view

Expected flow

  • Card will disappear even from 2+ page

Solution with global state

  • I chose jotai for global state implementation, but doesn't really matter
  • The loadMore component uses global state vs local useState
  • The delete button adjusts the global state and removes the rendered item (identified by it's key)
  • First page is not in the global store and the item will be removed as usual (through the partial page refresh)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published