Does it make sense to use react-query when our site is only pulling data from a CMS and…
- User
Does it make sense to use react-query when our site is only pulling data from a CMS and using getStaticProps and getStaticPaths for our content
- Assistant
React Query is a powerful library that can be used to manage the fetching and caching of data in your React application. However, whether or not it makes sense to use React Query in your specific scenario depends on a few factors.
If your site is only pulling data from a CMS and using
getStaticPropsandgetStaticPathsfor your content, then you may not need React Query. ThegetStaticPropsandgetStaticPathsfunctions are used to pre-render pages at build time by fetching data from a CMS or other data source. Since the data is fetched at build time and does not change during runtime, you may not need to worry about managing data fetching and caching with React Query.That being said, if your site has any dynamic content or needs to fetch data from APIs at runtime, then React Query can be very helpful. React Query can help you manage the state of your data fetching, automatically handle caching and deduplication, and provide helpful features like automatic retries and pagination.
In summary, if your site is purely static and does not require any runtime data fetching, you may not need to use React Query. However, if your site has any dynamic or runtime data requirements, then React Query can be a helpful library to manage your data fetching and caching needs.