React Query is a library that provides hooks to query and update data from your React application.
It shines with the way it handles a local cache to provide a sweet user experience.
When requesting multiples time the same data, the library is able to retrieve the previous result of the query from its cache, while re-fetching fresh data in the background. As a result the user does not have to wait for the fresh data, staring at a loading indicator.
This concept of “State While Revalidate” is also used by the library SWR but React Query provides a lot of extra features like pagination and pre-fetching. The killer feature may be a specific debugging tool that lets you visualize the content of the local cache, for each request that was made, with the different statuses (“fresh”, “fetching”, “stale”…).
The author Tanner Linsley has two other interesting projects on Best of JavaScript:
Growing Fast This Week
1 | Midori Library for animating image backgrounds in websites | Homepage | +44.2% | |
2 | beautiful-react-hooks A collection of beautiful and (hopefully) useful React hooks | Homepage | +11.8% | |
3 | Docx Easily generate .docx files with JS/TS with a nice declarative API | Homepage | +11.5% | |
4 | React Query Hooks for fetching, caching and updating asynchronous data in React | GitHub | +7.5% | |
5 | Rough Notation Create and animate hand-drawn annotations on a web page | Homepage | +6.6% | |
6 | Kleur The fastest Node.js library for formatting terminal text with ANSI colors~! | GitHub | +6.1% | |
7 | Vite Native-ESM powered web dev build tool. It's fast. | GitHub | +5.7% | |
8 | Best of JavaScript A place to find the best components to build amazing web applications | Homepage | +4.7% | |
9 | ToastUI Grid The Powerful Component to Display and Edit Data | Homepage | +4.4% | |
10 | Recoil An experimental state management library for React apps | Homepage | +4.2% |
Trending This Week
1 | React Query Hooks for fetching, caching and updating asynchronous data in React | GitHub | +595 ★ | |
2 | Deno A secure JavaScript and TypeScript runtime | Homepage | +438 ★ | |
3 | Vite Native-ESM powered web dev build tool. It's fast. | GitHub | +405 ★ | |
4 | Tailwind CSS A utility-first CSS framework for rapid UI development. | Homepage | +372 ★ | |
5 | You Don't Know JS A book series on JavaScript | GitHub | +350 ★ | |
6 | Vue.js A progressive, incrementally-adoptable framework for building UI on the web | Homepage | +340 ★ | |
7 | Clean Code Clean Code concepts adapted for JavaScript | GitHub | +337 ★ | |
8 | Turbolinks Turbolinks makes navigating your web application faster | GitHub | +326 ★ | |
9 | React A declarative, efficient, and flexible JavaScript library for building UI | Homepage | +322 ★ | |
10 | beautiful-react-hooks A collection of beautiful and (hopefully) useful React hooks to speed-up yo... | Homepage | +314 ★ |
Any question or feedback? Reach us on GitHub.
Best of JavaScript is a project created by Michael Rambeau, made in Osaka, Japan.