What’s new in react-query v2
Blog post from LogRocket
React-query v2 has introduced several new features and improvements, including changes to the API and overall performance enhancements. A notable update is the addition of a new query state called 'idle,' allowing more precise messaging based on query status. The queryCache now re-fetches only active queries, enhancing efficiency, while the global configuration object is now sectioned into shared, queries, and mutations sub-objects. The update also simplifies query status management by allowing the assignment of queries to a single variable using new booleans like isLoading, isSuccess, and isError. The process of migrating from version 1 to version 2 involves updating the global configuration and query handling in the app components, ensuring the application maintains its functionality with the new version. These enhancements are aimed at improving developer experience and application performance.