2020-12-21
1215
#react
Lawrence Eagles
30639
Dec 21, 2020 ⋅ 4 min read

Advanced React Hooks: Creating custom reusable Hooks

Lawrence Eagles Senior full-stack developer, writer, and instructor.

Recent posts:

Understanding Promise.all in JavaScript

Is Promise.all still relevant in 2025?

In 2025, async JavaScript looks very different. With tools like Promise.any, Promise.allSettled, and Array.fromAsync, many developers wonder if Promise.all is still worth it. The short answer is yes — but only if you know when and why to use it.

Leonardo Maldonado
Oct 29, 2025 ⋅ 7 min read
the replay october 29

The Replay (10/29/25): Tiny AI agents, Next.js 16, and more

Discover what’s new in The Replay, LogRocket’s newsletter for dev and engineering leaders, in the October 29th issue.

Matt MacCormack
Oct 29, 2025 ⋅ 34 sec read
next js 16 is here

Next.js 16: What’s new, and what it means for frontend devs

Learn about the new features in the Next.js 16 release: why they matter, how they impact your workflow, and how to start using them.

Abiola Farounbi
Oct 29, 2025 ⋅ 5 min read
is Llama really as bad as people say? I put Meta’s AI to the test

Is Llama really as bad as people say? I put Meta’s AI to the test

Test out Meta’s AI model, Llama, on a real CRUD frontend projects, compare it with competing models, and walk through the setup process.

Chizaram Ken
Oct 29, 2025 ⋅ 11 min read
View all posts

3 Replies to "Advanced React Hooks: Creating custom reusable Hooks"

  1. You are mistaken.. The first return statement is in the effect (function passed to useEffect) & not a directly under the main function like the second.

  2. Your useIsMounted is better off using useRef than useState, because useState causes your component to rerender

Leave a Reply

Hey there, want to help make our blog better?

Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.

Sign up now