useeffect
React useEffect hook for side effects
Learn why Bootstrap 'shown.bs.modal' event fires twice in React useEffect (empty deps, no StrictMode) but once in plain JS. Fixes include cleanup, ref guards, and react bootstrap alternatives for reliable modal events.
Don't return cleanup from useEffectEvent. Keep lifecycle cleanup inside useEffect; useEffectEvent should be for stable event logic to avoid stale closures.
Explain how React useEffect placement and unreachable early returns affect child re-renders with react-hook-form. Covers hook order and practical fixes.
Resolve the React warning 'Calling setState synchronously within an effect' in Next.js 16.0.7 with React 19.2.0. Learn useEffectEvent, batching multiple state updates, and best practices to avoid cascading renders and performance issues.