Loading tutorials
useState hook. You should also know that a component re-renders when its state changes. No knowledge of useEffect is needed yet. This chapter explains why the hook exists.2 min readuseState, and that you know a state change makes React call your component again. The previous chapter covered pure rendering. Here you learn to spot the code that breaks purity.2 min readuseState, and how a state change triggers a re-render. It also assumes you know what a side effect is from the previous chapter. Here you write your first effect and learn when React runs it.2 min readuseState, how a state change triggers a re-render, and the basic useEffect(setup) call from the previous chapter. Here you learn how the second argument, the dependency array, decides when an effect runs again.2 min readuseState, closures, and the basics of useEffect and its dependency array. Here you will learn how to undo what an effect started.2 min readuseState, closures, and how useEffect uses a dependency array and a cleanup function. Event listeners, subscriptions and timers all start something that keeps running after the effect body finishes. That makes them the most common reason to write cleanup.2 min readuseState, closures, Promises, and fetch. You should also know how the dependency array and cleanup functions work from the earlier chapters.2 min readuseState, how a component re-renders, and the basics of useEffect and its dependency array. It covers how to decide where a piece of side-effect code belongs.2 min readuseState, how state changes trigger re-renders, and the basics of useEffect and its dependency array.2 min readuseState, and the dependency array and cleanup rules from the earlier chapters.2 min readuseState, the basic useEffect syntax, how the dependency array decides when an effect runs, and how JavaScript closures work.2 min readuseState, the render and commit cycle, and how useEffect cleanup works. It explains why an effect's setup code seems to run twice, and how to write effects that don't mind.2 min readuseEffect with a dependency array and a cleanup function, and that you have seen the window resize and data fetching examples from earlier chapters.2 min readuseEffect, dependency arrays, cleanup functions, and the difference between stale closures and unstable dependencies from earlier chapters. It shows how to let tooling catch effect bugs and how to find the ones it misses.2 min readuseRef.2 min readuseEffect, dependency arrays and cleanup functions from the earlier chapters. It also assumes you know that React renders first and then commits changes to the DOM.2 min read