DEV Community 👩‍💻👨‍💻

Helder B. Berto
Helder B. Berto

Posted on

New React Hook: 📦 use-is-mounted-ref

Today I moved a hook that I use to fix the problem of setting the state to an unmounted component and commonly receives the following error:

Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.
Enter fullscreen mode Exit fullscreen mode

I created the following package:
use-is-mounted-ref

Maybe this can help you to solve this same problem. :)

Feel free to give feedback and share your experience with this topic.

Latest comments (0)

Need a better mental model for async/await?

Check out this classic DEV post on the subject.

⭐️🎀 JavaScript Visualized: Promises & Async/Await

async await