Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Understanding Actions Generated by Slices | Creating and Managing State with Slices
Керування станом з Redux Toolkit у React

bookUnderstanding Actions Generated by Slices

Свайпніть щоб показати меню

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.

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 4

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Секція 3. Розділ 4
some-alt