- How to Trigger React Error Boundary (Dev and Test)· 4 min read
Trigger a React error boundary by throwing during render, testing the fallback in Jest, and using showBoundary for async or event-handler errors.
- Check If Clicked Element Is Descendant Close On Click Outside· 3 min read
Detect click outside a modal or dropdown using contains() method.
- Eslint Enforce Named Function In Useeffect· 2 min read
Enforce named functions inside useEffect for better debugging and stack traces.
- React Useref Property Not Exist On Type Never· 2 min read
Fix the confusing TypeScript error when using useRef with proper type arguments.