A hook that will execute the specified callback when the component mounted.
import React from 'react';
import { useMount } from '@vergiss/chooks';
export default () => {
useMount(() => console.log('Mounted'));
return (
<span>Hello world</span>
)
}
useMount(
callback: (...args: any[]) => any
)
Property | Description | Type | Default |
---|---|---|---|
callback | Necessary | function |
- |