Improving Your Apps with Custom Hooks and React-Query
Zach Taylor will be going over two things that have greatly helped me improve the quality of my React code: custom hooks and react-query.
Custom Hooks: One of the main reasons I, and many others, love React is that it allows us to organize markup into reusable pieces. Custom hooks allow us to do the same thing with application state. This might sound mysterious, but it’s not: custom hooks are just functions. And because they are just functions, they can do all the things functions can do. They are reusable, and they can help you maintain separation of concerns in your application.
React-Query: Application state can always be organized into two categories: UI state and server state. You’ve probably noticed the distinction because server state comes with several unique challenges. React-Query is an awesome library that solves these challenges and will help you manage server state the right way, making your app much more performant and maintainable. And when you combine react-query with custom hooks, things get even better!