Simple Portal Toast

Hard
8 views 25 Jan 2026
Create a Toast that renders at the end of body using createPortal....

Effect Cleanup With Timer

Medium
8 views 25 Jan 2026
Start a timer in useEffect and clean it up on unmount....

Fetch Data With Loading And Error

Hard
7 views 25 Jan 2026
Fetch a fake list and show loading/error/success UI....

Click Outside To Close

Hard
8 views 25 Jan 2026
Close a dropdown when clicking outside of it using refs and effects....

Debounced Search Input

Hard
7 views 25 Jan 2026
Debounce a search input so it updates results after user stops typing....

usePrevious Value Hook

Medium
7 views 25 Jan 2026
Create a small hook that returns the previous value of a prop/state....

useLocalStorage State

Hard
8 views 25 Jan 2026
Create a hook that syncs a string value to localStorage....

Abort Fetch On Unmount

Hard
8 views 25 Jan 2026
Fetch data and cancel the request using AbortController on cleanup....

Document Title From Select

Medium
6 views 25 Jan 2026
Update document.title when a piece of state changes....

Window Width Listener

Medium
7 views 25 Jan 2026
Show window width and update it on resize using an effect....

Custom useInterval Hook

Hard
6 views 25 Jan 2026
Create a useInterval hook and use it to increment a number....

Enter Key Shortcut

Hard
7 views 25 Jan 2026
Handle Enter key press to submit a message using document keydown....

useMediaQuery Hook

Hard
7 views 25 Jan 2026
Create a hook that returns true/false based on a media query....

Scroll Position Tracker

Medium
6 views 25 Jan 2026
Track scrollY and show it on the screen....

Custom useFetch Hook

Hard
10 views 25 Jan 2026
Create a useFetch hook that returns loading/error/data....

Effect Dependency Fix

Hard
7 views 25 Jan 2026
Fix an effect that uses state by including dependencies correctly....

useDebouncedValue Hook

Hard
8 views 25 Jan 2026
Create a hook that debounces a value and updates after a delay....

useInterval Hook

Hard
8 views 25 Jan 2026
Create a useInterval hook and use it to build a timer....

usePrevious Hook

Medium
7 views 25 Jan 2026
Create a hook that returns the previous value and show it for a counter....

useOnClickOutside Hook

Hard
8 views 25 Jan 2026
Close a dropdown when user clicks outside of it....

useDocumentTitle With Cleanup

Medium
6 views 25 Jan 2026
Create a hook that sets document.title and resets it on unmount....

useEventListener Hook

Hard
9 views 25 Jan 2026
Create a hook to attach an event listener safely....

Abortable Fetch Effect

Hard
7 views 25 Jan 2026
Fetch data in an effect and cancel when the component unmounts....

useLocalStorage Hook

Hard
7 views 25 Jan 2026
Create a useLocalStorage hook and use it for a text setting....

useCopyToClipboard Hook

Hard
9 views 25 Jan 2026
Create a hook to copy text to clipboard and show success state....

Measure Width With LayoutEffect

Hard
8 views 25 Jan 2026
Measure an element width after layout and show it on the UI....

useOnlineStatus Hook

Medium
7 views 25 Jan 2026
Create a hook that tracks online/offline status....

Hash Route Listener

Hard
8 views 25 Jan 2026
Listen to hash changes and show the active section name....

Focus Input On Mount

Medium
6 views 25 Jan 2026
Focus an input when the component mounts....

Close On Escape

Hard
7 views 25 Jan 2026
Close a modal-like box when user presses Escape....

Auto Save With Cleanup

Hard
7 views 25 Jan 2026
Auto-save text after user stops typing and cancel the pending save on change....

useId For Form Labels

Medium
8 views 25 Jan 2026
Build a small form that uses useId to link label and input....