---
title: "Discussion on \"React hook - useReducer - simple State & Action\" | Hashnode"
description: "Discussion on \"React hook - useReducer - simple State & Action\". 1. Các bước làm\n1-1. Import useReducer\nimport { useReducer } from 'react'\n1-2. Khởi tạo giá trị ban đầu\nconst initialState = 0\n1-3. Tạo hàm reducer\n\nHàm này nhận 2 tham số\nTham số 1 là state muốn thay đổi giá trị\nTham số 2 là action\nTùy vào loại acti..."
url: "https://hashnode.com/posts/react-hook-usereducer-simple-state-and-action/60f3f00d66fcdb0a02743916"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [React hook - useReducer - simple State & Action](https://kentrung.hashnode.dev/react-hook-usereducer-simple-state-and-action?utm_source=hashnode&utm_medium=feed)

1\. Các bước làm 1-1. Import useReducer import { useReducer } from 'react' 1-2. Khởi tạo giá trị ban đầu const initialState = 0 1-3. Tạo hàm reducer Hàm này nhận 2 tham số Tham số 1 là state muốn thay đổi giá trị Tham số 2 là action Tùy vào loại acti...

Jul 18, 2021 · 2 min read · kentrung.hashnode.dev  
Updated Jul 19, 2021  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#reacthooks](https://hashnode.com/tag/reacthooks)

## Written by

[ken trung](https://hashnode.com/@kentrung)

@kentrung · Vietnam

  
[View profile](https://hashnode.com/@kentrung)

developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
