useEffectOnce

A React Hook like React.useEffect but only run once, equivalent to useEffect(callback, []), but with more semantic name. It's merely an alias to useEffect with an empty dependency array.

Demo

Source
Count:
0

Usage

See API for more details.

Source

Click links below to view source on GitHub.

API

// alias to `useEffect(callback, [])` with more semantic name useEffectOnce(callback)

Callback

Same as React.useEffect.