> For the complete documentation index, see [llms.txt](https://dailyjournal.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dailyjournal.gitbook.io/notes/languages/javascript/libraries/react/hooks.md).

# Hooks

A special function that lets you “hook into” React features.

* Hooks were first introduced in React 16.8.
* Hooks let us use state and other React features without writing a class.

{% content-ref url="/pages/AclqRvvRI1zcPM6nBMO3" %}
[useState](/notes/languages/javascript/libraries/react/hooks/usestate.md)
{% endcontent-ref %}

{% content-ref url="/pages/0jAMTc0NXLYigZZ1gKNs" %}
[useEffect](/notes/languages/javascript/libraries/react/hooks/useeffect.md)
{% endcontent-ref %}

## Resources

{% embed url="<https://www.syncfusion.com/blogs/post/understanding-reacts-useeffect-and-usestate-hooks.aspx>" %}

## FAQs

* How do React Hooks differ from traditional React components?
* Can you give an example of how you would use the useState hook in a React application?
* How do React Hooks help with code reuse and separation of concerns?
* Can you demonstrate how to test a custom React Hook?
