Skip to main content

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

NameTypeDescription
funcEffectCallbackA 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;