mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
50556df713
Co-authored-by: Adrián Jesús Peña Rodríguez <adrianjpr@gmail.com> Co-authored-by: Alan Buscaglia <gentlemanprogramming@gmail.com>
13 lines
340 B
TypeScript
13 lines
340 B
TypeScript
"use client";
|
|
|
|
import { EffectCallback, useEffect } from "react";
|
|
|
|
/**
|
|
* Runs an effect exactly once on component mount.
|
|
* Project-approved wrapper — use this instead of useEffect(..., []).
|
|
*/
|
|
export function useMountEffect(effect: EffectCallback) {
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
useEffect(effect, []);
|
|
}
|