---
title: "Discussion on \"A Look At React Hooks: useCallback\" | Hashnode"
description: "Discussion on \"A Look At React Hooks: useCallback\". Introduction to the useCallback Hook"
url: "https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3"
---

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

Discussion

# [A Look At React Hooks: useCallback](https://blog.lo-victoria.com/a-look-at-react-hooks-usecallback?utm_source=hashnode&utm_medium=feed)

Introduction to the useCallback Hook

Mar 8, 2021 · 10 min read · blog.lo-victoria.com  
Updated Mar 10, 2021  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#reacthooks](https://hashnode.com/tag/reacthooks)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#beginners](https://hashnode.com/tag/beginners)
-   [#tutorial](https://hashnode.com/tag/tutorial)

## Written by

[Victoria Lo](https://hashnode.com/@victoria)

@victoria · Singapore

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

A nerd in books, tea, games and software.

I'm a solutions engineer lead, GitHub Star, Director of WomenDevsSG, and co founder of ragTech. I work at the intersection of tech, systems, and leadership, and this blog is where I share my journey through all three. Expect honest reflections, real experiences, and thoughts that are still forming rather than polished career advice.

## Responses 9

Markdown supported · ⌘↵ to post

[Nikhil Patil](https://hashnode.com/@nikhilPatil)

[Jan 3, 2024](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/6595b2e4febf0930b10b237f)

Great source for learning useCallback! well done!

[Steve Woodward](https://hashnode.com/@steveanthony999)

[Jun 24, 2022](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/62b6405592447c9aed5b639c)

Such a great and easy to understand article Victoria! Thank you for that! One question, how did developers handle this before hooks?

[Gopal Bharadva](https://hashnode.com/@gopalBharadva)

[Jun 10, 2022](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/62a2a5d523f5f5accf274516)

If I use contexts in any project , then we are not passing a props, so there will be no need to to use callbacks right, as the component will only re-render the component if the state value which it uses changed. Am I right?

[Tamiris Simoneli](https://hashnode.com/@tamihh)

[Mar 26, 2021](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/605e36ba5aa4944ee40f7878)

That's the article I needed! Very well explained, thanks [Victoria Lo](https://hashnode.com/@victoria) :)

[Favourite Jome](https://hashnode.com/@Favourite)

[Mar 9, 2021](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/6047e3417f43655434aaf366)

Interesting hook! Well this is my first time seeing this hook in action. I'll keep note of what it does for future use.

[Badal sharma](https://hashnode.com/@badal897)

[Mar 9, 2021](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/60473ecca2c0664a97e77fde)

Increase and Decrease anyway are not getting called again and again when the component gets rerendered then why did you use useCallback ?

[Victoria Lo](https://hashnode.com/@victoria)

[Mar 10, 2021](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/60473ecca2c0664a97e77fde#reply-60483346c64c63545921cd3b)

Hi thanks for the question. Every time a React component re-renders, a new function gets created. So without the `useCallback`, new increase and decrease functions are created every time the App component renders.

This is known as referential equality. The increase and decrease functions that loads on every render does not point to the same functions in memory (even though they have the same name, logic, etc.).

Using useCallback tells React to cache the increase and decrease functions if `number` does not change. When `number` is changed, the function is then updated.

So, only using React.memo() will still result in unnecessary components rendering because the increase and decrease functions passed as props in Counter are returned as new functions each time app renders. The React.memo(Counter) component detects a change in the component's props and therefore will re-render it. ![onlymemo.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1615345667578/tBLT3lJMV.gif)

I hope that explains it. I will edit the article to make it more clear. Thanks!

[Badal sharma](https://hashnode.com/@badal897)

[Mar 9, 2021](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/60473e69ad7c5f4abc7cd32f)

What will happen if I use React.memo() only and not useCallback

[Edidiong Asikpo (Didi)](https://hashnode.com/@didicodes)

[Mar 9, 2021](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/60472766ad7c5f4abc7cd0c1)

This was super useful to me [Victoria Lo](https://hashnode.com/@victoria).

[Catalin Pit](https://hashnode.com/@Catalinpit)

[Mar 9, 2021](https://hashnode.com/posts/a-look-at-react-hooks-usecallback/60463c3b73cc1742999bfae3/comment/60471508a88846493e147385)

Great article as always, [Victoria Lo](https://hashnode.com/@victoria)! Well done! 👏
