Loading tutorials
async/await, and basic HTTP: methods, status codes, and JSON. You don't need React yet. The next chapters put this code inside components.2 min readuseState hook, and promises with async/await. It covers when a component should start a request. The next chapter writes the fetch itself.3 min readuseState hook. It also assumes you know basic HTTP: methods, status codes, and JSON. You should have seen the Fetch API and the dependency array of useEffect in the previous chapters.2 min readuseState, promises and async/await, and how useEffect runs a fetch when its dependencies change. Here you will decide how a component represents the three things a request can be doing: waiting, failing, or succeeding.2 min readuseEffect that fetches data, keep loading, error, and success state in useState, and read promise chains. It covers what goes wrong when the effect's inputs change while a request is still running.2 min readuseEffect and its dependency array, useState, promises, and the fetch response checks from earlier chapters. It also assumes you have seen the race condition that happens when an input changes while a request is still running.3 min readuseEffect and its dependency array, the fetch API with AbortController, and how to write cleanup functions. You have probably seen a request fire twice in the Network tab while developing. This chapter explains why and what to do about it.3 min readuseEffect, tracks loading and error state, and cancels requests with AbortController. It also assumes you know the useState hook and basic Fetch API behavior, including checking response.ok.2 min readuseEffect, you understand the dependency array, and you have seen the useFetch hook from the previous chapter. It covers how nested components can slow data loading, and how to fix it.2 min readuseEffect with loading and error states, abort on cleanup, and extract that logic into a useFetch hook. Here you will see what that approach still does not give you.2 min readuseState, useEffect, promises and async/await, and how to check response.ok with fetch. You have already written loading, error, and success states by hand. Here you replace that code with a library.3 min readuseQuery call, as shown in the previous chapter. You should also know what a React component re-render is. Here you will learn how query keys identify cached data and how staleness decides when a refetch happens.2 min readuseQuery, know what a query key is, and understand that TanStack Query keeps a cache of server data. Here you will send changes to the server and make the screen match the result.2 min readuse hook is available.2 min readuseEffect fetching works, how loading and error states are modeled, and what a data library such as TanStack Query adds. It also assumes you have read the previous chapter on Suspense and the use hook.2 min readuseEffect and cleanup, the useFetch hook pattern, TanStack Query basics, and what Suspense and Server Components do. Here you compare the options and pick one for a given situation.2 min read