1import {useEffectOnce} from 'react-use';
2
3const Demo = () => {
4 useEffectOnce(() => {
5 console.log('Running effect once on mount')
6
7 return () => {
8 console.log('Running clean-up of effect on unmount')
9 }
10 });
11
12 return null;
13};