useOnce ​
humor
test coverage
Last changed: 10 days ago
WARNING
This hook will run effect only once even in strict mode. Please do not use it in production code!
Hook that runs an effect only once. Please do not use it in production code!
typescript
import { useOnce } from '@siberiacancode/reactuse';
Usage ​
typescript
useOnce(() => console.log('effect once'));
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
effect | EffectCallback | - | The effect to run |