Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Understanding Actions Generated by Slices | Creating and Managing State with Slices
Gerenciamento de Estado com Redux Toolkit no React

bookUnderstanding Actions Generated by Slices

Deslize para mostrar o menu

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.

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 4

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Seção 3. Capítulo 4
some-alt