---
title: "Discussion on \"How the useCallback hook works\" | Hashnode"
description: "Discussion on \"How the useCallback hook works\". useCallback hook is used for performance optimization and to cache something.\nWhen do we use useCallback?\nIt is used to freeze a function reference.\nSee, whenever a component renders, all the functions of the component are created.Therefore, when a c..."
url: "https://hashnode.com/posts/usecallback-hook-when-why-how/6805ed30fea51624fcde52fd"
---

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

Discussion

# [How the useCallback hook works](https://learnwithriya.hashnode.dev/usecallback-hook-when-why-how?utm_source=hashnode&utm_medium=feed)

useCallback hook is used for performance optimization and to cache something. When do we use useCallback? It is used to freeze a function reference. See, whenever a component renders, all the functions of the component are created.Therefore, when a c...

Apr 21, 2025 · 2 min read · learnwithriya.hashnode.dev  
Read the article

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

## Written by

[Riya Agarwal](https://hashnode.com/@RiyaAgarwal)

@RiyaAgarwal · India

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

Exploring the world of softwares

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
