> For the complete documentation index, see [llms.txt](https://pea-story.gitbook.io/pexpa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pea-story.gitbook.io/pexpa/knowledge/reactjs/react-hook/using-the-state-hook.md).

# useState Hook

React.useState là một Hook trong ReactJS được sử dụng để xử lý state trong các function component với cú pháp

`const [state, setState] = React.useState(param)`

{% hint style="info" %}
**state**: giá trị của state\
**setState**: là một hàm được dùng để truyền giá trị vào state\
**param**: là một giá trị khởi tạo cho state&#x20;
{% endhint %}
