---
title: "Comment by Gabriele Petrioli on \"Common Mistakes When Using React useState Hook (With Code Examples)\" | Hashnode"
description: "On your second point (2.Passing Functions Inline) using inline function or useCallback will not solve the issue if the handler is bound through a useEffect . Yo"
url: "https://hashnode.com/posts/common-mistakes-when-using-react-usestate-hook/658eee24b1d168f170e51c36/comment/659ebb02e6a9d0776c8dd5c1"
---

[Discussion](https://hashnode.com/posts/common-mistakes-when-using-react-usestate-hook/658eee24b1d168f170e51c36)

Comment [Common Mistakes When Using React useState Hook (With Code Examples)](https://hashnode.com/posts/common-mistakes-when-using-react-usestate-hook/658eee24b1d168f170e51c36)

[Gabriele Petrioli](https://hashnode.com/@gpetrioli)

[Jan 10, 2024](https://hashnode.com/posts/common-mistakes-when-using-react-usestate-hook/658eee24b1d168f170e51c36/comment/659ebb02e6a9d0776c8dd5c1)

On your second point (2.Passing Functions Inline) using inline function or `useCallback` will not solve the issue if the handler is bound through a `useEffect`.

You should use the `onClick` of the element you want to bind. This way the inline would work directly. Also in your `useCallback` version, it would not work anyway since you give it an empty dependency array, which means it will still keep the stale `count` value for ever.
