---
title: "Discussion on \"useCallback when to use it\" | Hashnode"
description: "Discussion on \"useCallback when to use it\". function ParentComponent() {\n  const handleClick = () => {\n    // logic  \n  }\n\n  return (\n    <ChildComponent onClick={handleClick}  />\n  )\n}\nWhat problem with the above code?\nA performance problem. Every time ParentComponent re-render, ChildComponen..."
url: "https://hashnode.com/posts/usecallback-when-to-use-it/604f76ca825b051f2b9dbad6"
---

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

Discussion

# [useCallback when to use it](https://tungnt620.com/usecallback-when-to-use-it?utm_source=hashnode&utm_medium=feed)

function ParentComponent() { const handleClick = () => { // logic } return ( <ChildComponent onClick={handleClick} /> ) } What problem with the above code? A performance problem. Every time ParentComponent re-render, ChildComponen...

Mar 15, 2021 · 1 min read · tungnt620.com  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Tung Nguyen](https://hashnode.com/@tungnt)

@tungnt

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

programer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
