0% found this document useful (0 votes)
24 views1 page

Redux Toolkit Notes

Redux Toolkit allows for organizing store data into small pieces using createSlice, which generates action creators and types based on defined reducers. Reducers are pure functions that manage state changes in response to actions, while useDispatch and useSelector are hooks for managing local state and extracting data from the Redux store, respectively. Redux-Thunk is a middleware for handling asynchronous actions, with createAsyncThunk being the recommended method in Redux Toolkit.

Uploaded by

ahmadzaka071
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Redux Toolkit Notes

Redux Toolkit allows for organizing store data into small pieces using createSlice, which generates action creators and types based on defined reducers. Reducers are pure functions that manage state changes in response to actions, while useDispatch and useSelector are hooks for managing local state and extracting data from the Redux store, respectively. Redux-Thunk is a middleware for handling asynchronous actions, with createAsyncThunk being the recommended method in Redux Toolkit.

Uploaded by

ahmadzaka071
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Redux Toolkit:

SLice:
We can organise our store data in small pieces.
It automatically generates action creators and action types based on the reducers
you define.
With Redux Toolkit's createSlice, you can define reducers directly inside the
slice, making it more concise and readable.

Reducers:
Reducers are functions that specify how the application's state changes in response
to actions sent to the Redux store.
Reducers are pure functions which are used to change the state.

store.

useDispatch:
useReducer is used to manage the local component state

useSelector:
useSelector is a React Redux hook that allows you to extract data from the Redux
store state.

Redux-Thunk:
Thunk is a middleware in redux. It is inbuilt in rtk.
Think is a normal function. And it returns a new function that is async.
We can use thunk by 2 methods. one is old redux method. one is used in redux
toolkit. so in redux toolkit we have to use createASYNCThunk function and also we
have to create cases first for our actions.

Note: We have to use redux when our data is being used in multiple components.

You might also like