useDidMount More Info...
The useDidMount hook runs once when the component mounted. It is a shortcut for useEffect(() => {}, []).
import { useDidMount } from '@archibald/client';
useDidMount(PARAMETERS);
Parameters
| Name | Type | Description |
|---|---|---|
| func | EffectCallback | A callback function that should be executed in the hook. |
Example
// Other imports
import { useDidMount } from '@archibald/client';
function TestComponent() {
useDidMount(() => {
// Do something
});
return <div>Test</div>;
}
export default TestComponent;