diff --git a/examples/react/two-way-infinite-scroll/.gitignore b/examples/react/two-way-infinite-scroll/.gitignore new file mode 100644 index 00000000..d451ff16 --- /dev/null +++ b/examples/react/two-way-infinite-scroll/.gitignore @@ -0,0 +1,5 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local diff --git a/examples/react/two-way-infinite-scroll/README.md b/examples/react/two-way-infinite-scroll/README.md new file mode 100644 index 00000000..b168d3c4 --- /dev/null +++ b/examples/react/two-way-infinite-scroll/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run start` or `yarn start` diff --git a/examples/react/two-way-infinite-scroll/index.html b/examples/react/two-way-infinite-scroll/index.html new file mode 100644 index 00000000..3fc40c93 --- /dev/null +++ b/examples/react/two-way-infinite-scroll/index.html @@ -0,0 +1,13 @@ + + +
+ + ++ This code uses React Query and React Virtual to implement an interactive + infinite scroll feature. Its main features include setting maxPages to + limit the maximum number of pages, and fetching data from the server for + the previous or next page when the user moves the scroll up or down. + This saves memory and render costs. +
+ + {status === 'pending' ? ( +Loading...
+ ) : status === 'error' ? ( + Error: {(error as Error).message} + ) : ( +