With Pagination (in React)#
This example shows how to implement pagination with urql in your React UI code.
It renders several pages as fragments with one component managing the variables for the page queries. This example is also reapplicable to other libraries, like Svelte or Vue.
To run this example install dependencies and run the start script:
yarn install
yarn run start
# or
npm install
npm run start
This example contains:
- The
urqlbindings and a React app with a client set up insrc/App.js - A managing component called
PaginatedNpmSearchset up to render all pages insrc/PaginatedNpmSearch.jss - A page component called
SearchResultPagerunning page queries insrc/PaginatedNpmSearch.jsx