useMounted

Know whether the component has mounted in the browser.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

It is false on the server and on the first render.

APIs

useMounted

const useMounted = () => boolean
Edit this page on GitHub