Loading tutorials
useState call itself. Re-rendering, snapshots, and updater functions get their own chapters.2 min readuseState declared, as in the previous chapter.2 min readuseState. It also assumes you know that onClick and similar props accept functions.2 min readuseState and call a setter from an event handler. It explains what value your code sees after you call the setter.2 min readuseState with an event handler, and read arrow functions. You should also know that each render sees a fixed snapshot of state, covered in the previous chapter.2 min readuseState, call setters from event handlers, and that you know state is a snapshot for each render. Here you will see how several setter calls become one re-render.2 min readuseState, update it from event handlers, and use object spread syntax. It builds on the earlier chapters about state snapshots and re-rendering.2 min readuseState works, how event handlers call setters, and that each render sees a state snapshot. You should also be comfortable with spread syntax and computed property names in JavaScript.2 min readuseState, event handlers, spread syntax, and the array methods map and filter. It also assumes you know why state must not be mutated: React compares the old and new state values, and a mutated array is the same object as before.2 min readuseState, event handlers, and spread syntax. It also assumes you have seen state snapshots and immutable object updates.2 min readuseState, update objects and arrays without mutating them, and pass props between components. It covers how to organize state so that it is hard to get wrong.1 min readuseState works, how to update state from event handlers, and how to pass props. You should also be comfortable with map and filter.2 min readuseState, including updating state from event handlers. It covers what to do when two components need the same piece of state.2 min readuseState works, how a re-render happens, and basic JavaScript such as arrow functions and JSON.parse.2 min readuseState, props, and how a parent re-render re-renders its children. It explains how React decides which state belongs to which component, and how to reset that state on purpose.2 min readuseState, updater functions, and immutable updates to objects and arrays. It covers the point where several useState calls and handlers become hard to follow, and how useReducer helps.1 min readuseState, event handlers, state snapshots, updater functions, and immutable updates for objects and arrays. It collects the mistakes that come up most often and shows how to fix each one.2 min read