Loading tutorials
useState, how a function component re-runs on each render, and what a closure is. It explains why a ref keeps its value between renders and why changing it does not trigger one.2 min readuseState, and basic useEffect. It covers one question: when a value changes, should it live in state or in a ref?2 min readuseState, and basic DOM ideas such as elements and focus. You should also know that useRef returns an object that persists between renders.2 min readuseState, basic useEffect, JSX, and DOM ideas such as focus, scroll position, and element size.2 min readuseState, basic useEffect, JavaScript closures, and the idea that a ref is a container whose .current value survives renders. Here you will use refs to hold values that the screen never shows.2 min readuseState, and basic useEffect. You have seen that useRef returns an object with a current property that persists across renders. Here you learn when it is safe to read and write that property.2 min readuseState, basic useEffect with a dependency array, and the idea that a ref is a container whose .current survives renders. Here you will see when it is safe to read a ref in an effect, and how to handle cleanup.2 min readuseState, basic useEffect, and how useRef attaches to a DOM element. It covers the mistakes that cause most ref bugs and how to debug them.2 min readuseRef with an object ref (ref={inputRef}), useState, and useEffect. An object ref works well when you have one element and know about it ahead of time. A callback ref covers the cases where you don't.2 min readuseRef, attach it to a DOM element, and pass props between function components. It builds on those skills to cover refs that cross a component boundary.2 min readuseState, basic useEffect, and the rule that rendering must be pure. You should also know that useRef returns an object shaped like { current: value }.3 min readuseRef, how to attach a ref to a single DOM element, and the basics of callback refs. Here you will handle the case where you render many elements and need a handle on each one.2 min readuseRef with DOM elements, pass a ref from a parent to a child component, and read basic useEffect code.2 min readuseState, useEffect with a dependency array, closures, and that ref.current can be changed without causing a re-render.2 min read