@hooks/mount
Version:
React hook to execute callback on component mount
32 lines (19 loc) • 669 B
Markdown
# 🎒 @hooks/mount
React hook to execute callback on component mount



## Install
```bash
npm i @hooks/mount
```
## Usage
### useMount
```ts
useMount(callback: () => void, hook: (effect: EffectCallback, deps?: DependencyList) => void = useEffect)
```
#### Parameters
##### `callback: () => void`
Function to execute.
##### `hook: (effect: EffectCallback, deps?: DependencyList) => void = useEffect`
Hook to use, defaults to useEffect.