Why need to use?
@suspensive/react-query is used with the following motivation:
Hooks for Suspense are also available in @tanstack/react-query v4. (as well as @tanstack/react-query v5)
useSuspenseQuery, useSuspenseQueries, and useSuspenseInfiniteQuery, which were not originally available in @tanstack/react-query v4, can now be used. Currently, this hook is officially provided in @tanstack/react-query v5, making it a good alternative for migrating from @tanstack/react-query v4 to v5.
Solution for the issue of @tanstack/react-query v5 not being able to support lower version browsers due to es private field (opens in a new tab)
From version 2.2.0 onwards, @tanstack/react-query supports both v4 and v5. To support older browser versions, use @suspensive/react-query with @tanstack/react-query v4.
Apart from performance, many places still need to support lower browser versions such as Safari 12.1, 13, and 14. However, the browser compatibility of @tanstack/react-query v5 may limit its use because it targets high browser environments such as safari>=15.
-
Please check Why @tanstack/react-query v5 only support versions with high browser compatibility (es private field) (opens in a new tab).
In this case, @suspensive/react-query can be a good alternative to use with @tanstack/react-query v4 to help you use the interface of @tanstack/react-query v5. (@suspensive/react-query uses @tanstack/react-query v4 internally, allowing it to support Suspense and related hooks while maintaining lower version browser support.)
Browser compatibility of @tanstack/react-query v4 (opens in a new tab) and @tanstack/react-query v5 (opens in a new tab)
TanStack Query Browser Requirements | v4 | v5 |
---|---|---|
Chrome | >= 73 | >= 91 |
Firefox | >= 78 | >= 90 |
Edge | >= 79 | >= 91 |
Safari | >= 12.1 | >= 15 |
iOS | >= 12.2 | >= 15 |
Opera | >= 53 | >= 77 |
This library is currently a community resource for TanStack Query (opens in a new tab).
As it is a community resource registered in the official TanStack document, our Suspensive maintainers are providing full support.
We provide official documents that are easy for your team members to understand and provide prompt support if there are any issues. So you can use it with your teammates at production level with @tanstack/react-query v4.