---
title: "Gabriele Petrioli (@gpetrioli) | Hashnode"
description: "Gabriele Petrioli (@gpetrioli) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@gpetrioli"
---

@gpetrioli

# Gabriele Petrioli

@gpetrioli · Joined January 2024

## Comments

[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.](https://hashnode.com/posts/common-mistakes-when-using-react-usestate-hook/658eee24b1d168f170e51c36/comment/659ebb02e6a9d0776c8dd5c1)

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