Loading problem…
Create a helper hook useEffectOnce that runs setup logic exactly once per mount and handles cleanup correctly.
Implement:
function useEffectOnce(effect: () => void | (() => void)): voidUse this hook for one-time registration logic like analytics bootstrapping, event wiring, or websocket setup.
Explain how your implementation behaves under React Strict Mode development remount checks.