Understanding Actions Generated by Slices
Desliza para mostrar el menú
When you create a slice, Redux Toolkit automatically generates actions for you. You don't need to define them manually.
How Actions Are Created
Each reducer you define becomes an action. For example, if you have:
increment(state) {
state.value += 1;
}
Redux Toolkit creates an action called 'counter/increment'.
Using Actions
You can import and use these actions in your components:
import { increment } from './counterSlice';
dispatch(increment());
The action is sent to the store, and the corresponding reducer runs.
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 3. Capítulo 4
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Sección 3. Capítulo 4