---
title: "Discussion on \"React hook - useReducer - complex State & Action\" | Hashnode"
description: "Discussion on \"React hook - useReducer - complex 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 = { firstName: 'Ken', lastName: 'Trung' }\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ị..."
url: "https://hashnode.com/posts/react-hook-usereducer-complex-state-and-action/60f4530bbb67011cb836c651"
---

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

Discussion

# [React hook - useReducer - complex State & Action](https://kentrung.hashnode.dev/react-hook-usereducer-complex-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 = { firstName: 'Ken', lastName: 'Trung' } 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ị...

Jul 18, 2021 · 2 min read · kentrung.hashnode.dev  
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.
