day-cohort-70 / Bangazon-API-BandyChamps

0 stars 0 forks source link

Learning Spike: TanStack Query #7

Open stevebrownlee opened 2 months ago

stevebrownlee commented 2 months ago

You may have discovered that many components within your application need to represent the same state, and that you often need to pass state from a parent to a child component using props. Your team likely discovered the Next.js provides a built-in function named useAppContext() that allows any component in the tree to access common, shared state.

There is another, third-party popular tool available for software developers today called TanStack Query (formerly known as React Query). This will allow any component to either set, or mutate (change) state when it needs to change.

Since the Bangazon platform is growing quickly and the business anticipates the feature-set of the UI to grow significantly over the next year, you need to investigate this tool to ensure that the component code stays as minimal, consistent, and DRY as possible. As a team, identify some state that is used in multiple components in the application and see if you can implement it with TanStack Query instead of relying on your service modules and/or useAppContext().

Start with reading Level Up Your Full-Stack Development with React Query

This would also be a great opportunity for the team to practice your prompt design skills with a LLM tool and provide context needed to implement the tool.