useUnmount

A React Hook that helps to run a callback when the component unmounts.

Demo

Source
Child

Usage

See API for more details.

Source

Click links below to view source on GitHub.

API

useUnmount(callback)

Callback

A function that will be called when the component unmounts, can be async.