Loading tutorials
createSlice and configureStore, so it helps to see the plain pieces first.6 min readcreateSlice. You should know that a reducer receives the current state and an action, and that Redux needs a new state object whenever something changes. You should also be comfortable with spread syntax and with the di5 min readcreateSlice and know that a reducer is a pure function of (state, action). It also assumes you know what an action is. Here you build the store that holds your slice reducers and see what configureStore adds beyond plain Redux.5 min readuseState and useEffect. It also assumes you have a store from configureStore and at least one slice from createSlice. The chapter covers how React-Redux connects that store to your components, how re-renders are decided, and the mis5 min readuseSelector (covered in earlier chapters). It explains how to compute values from store state without causing extra renders or repeated work.4 min readcreateSlice, read the store with useSelector, and know the difference between local component state and shared state. Here you decide which data belongs in the Redux store and how to lay it out so reducers and selectors stay simple.4 min readtypeof, ReturnType), have a working store from the earlier chapters, and use React-Redux 9.1 or later. Redux Toolkit ships its own type definitions, so you install nothing extra. The goal is to let the compiler infer as much a4 min readcreateSlice and that you know the Redux flow of dispatch, reducer and new state. It also assumes you know RTK 2.x syntax, where extraReducers takes a builder callback. By the end you will be able to make one slice react to actions it did not define5 min readcreateSlice, build a store with configureStore, and read state in components with useSelector and useDispatch. It also assumes you know async/await and fetch. By the end you will be able to load data, track its loading and error state, an4 min readuseSelector and useDispatch. It also assumes you have seen createAsyncThunk. RTK Query is included in the @reduxjs/toolkit package, so you don't need to install anything else.5 min readcreateSlice, read state with useSelector, and write simple selectors. It builds on the ideas in the earlier chapters about state shape and selectors.5 min readconfigureStore, and that you know how thunks work from the async chapter. It covers what middleware is, which middleware RTK installs by default, how to write your own, and how the listener middleware runs side effects in respon4 min readconfigureStore, write slices with createSlice, and dispatch actions from React components. It also assumes you have seen createAsyncThunk actions such as pending and fulfilled. Here you will learn how to see what the store is doing an6 min readcreateSlice, build a store with configureStore, and write selectors with createSelector. It also assumes basic experience with a test runner (Vitest or Jest) and React Testing Library. The examples use Vitest. In Jest, drop the vitest imports a4 min read