> masteringswe_

React JS

Questions

Effects9

useEffect - log when a value changes
codinglocked
Sign up to unlock
useEffect - remove a listener in cleanup
codinglocked
Sign up to unlock
useEffect - dependency array trace
conceptuallocked
Sign up to unlock
useEffect - syncing a computable value
codinglocked
Sign up to unlock
useEffect - object dependency recreated each render
codinglocked
Sign up to unlock
useEffect - stale closure in setInterval
codinglocked
Sign up to unlock
useEffect - infinite fetch loop
codinglocked
Sign up to unlock
useEffect - missing dependency
codinglocked
Sign up to unlock
useEffect - when cleanup runs
conceptuallocked
Sign up to unlock

Events & Forms5

Controlled vs. uncontrolled components
conceptuallocked
Sign up to unlock
Controlled text input
codinglocked
Sign up to unlock
onClick={fn} vs. onClick={fn()}
codinglocked
Sign up to unlock
preventDefault on form submit
codinglocked
Sign up to unlock
Synthetic events
conceptuallocked
Sign up to unlock

Rendering9

0 && rendering gotcha
codinglocked
Sign up to unlock
Conditional rendering
codinglocked
Sign up to unlock
Changing a component's key
codinglocked
Sign up to unlock
Keys in lists
codinglocked
Sign up to unlock
Virtual DOM and reconciliation
conceptuallocked
Sign up to unlock
Render vs. commit phase
conceptuallocked
Sign up to unlock
What triggers a re-render
conceptuallocked
Sign up to unlock
Pure render - mutating an outer variable
codinglocked
Sign up to unlock
Pure render - sorting a prop in place
codinglocked
Sign up to unlock

State6

Immutable array updates
codinglocked
Sign up to unlock
useState - functional updates
codinglocked
Sign up to unlock
Why not mutate state
conceptuallocked
Sign up to unlock
State updates - snapshots and batching
conceptuallocked
Sign up to unlock
Immutable object update
codinglocked
Sign up to unlock
useState - declare state
codinglocked
Sign up to unlock

Components & Props4

Props
codinglocked
Sign up to unlock
Function vs. class components
codinglocked
Sign up to unlock
Props - default values
codinglocked
Sign up to unlock
children prop
conceptuallocked
Sign up to unlock

JSX3

JSX - rendering a list
codinglocked
Sign up to unlock
JSX - expressions and fragments
codinglocked
Sign up to unlock
JSX - attributes
codinglocked
Sign up to unlock

Refs4

React 19 - ref as a prop
codinglocked
Sign up to unlock
useRef - keep an interval id across renders
codinglocked
Sign up to unlock
useRef - focus a DOM input
codinglocked
Sign up to unlock
useRef - changing a ref doesn't re-render
conceptuallocked
Sign up to unlock

Performance & Memoization9

useMemo - when it's worth it
conceptuallocked
Sign up to unlock
useMemo - memoize an expensive filter
codinglocked
Sign up to unlock
React Compiler - drop manual memoization
codinglocked
Sign up to unlock
React Compiler - code that breaks the rules
conceptuallocked
Sign up to unlock
useCallback - without React.memo
conceptuallocked
Sign up to unlock
React.memo - inline object prop
codinglocked
Sign up to unlock
React.memo - render trace
conceptuallocked
Sign up to unlock
useCallback - stale dependency
codinglocked
Sign up to unlock
useCallback - stable handler for a memo child
codinglocked
Sign up to unlock

State Structure3

Derived state - store the id, not the object
codinglocked
Sign up to unlock
Lifting state up
codinglocked
Sign up to unlock
Derived state - copying props into state
codinglocked
Sign up to unlock

Reducers3

useReducer vs. useState
conceptuallocked
Sign up to unlock
useReducer - write the reducer
codinglocked
Sign up to unlock
useReducer - dispatch actions
codinglocked
Sign up to unlock

Context4

Context - unstable Provider value
codinglocked
Sign up to unlock
Context - who re-renders on a value change
conceptuallocked
Sign up to unlock
Context - nearest Provider and default value
conceptuallocked
Sign up to unlock
Context - replace prop drilling
codinglocked
Sign up to unlock

Data Fetching3

Data fetching - cancel with AbortController
codinglocked
Sign up to unlock
Data fetching - loading and error states
codinglocked
Sign up to unlock
Data fetching - race condition
codinglocked
Sign up to unlock

Composition3

Composition - replace inheritance
codinglocked
Sign up to unlock
Composition - render props
codinglocked
Sign up to unlock
Composition - multiple slots
codinglocked
Sign up to unlock

Hooks5

Custom hooks - the use prefix
codinglocked
Sign up to unlock
Custom hooks - each call has its own state
conceptuallocked
Sign up to unlock
Custom hooks - extract shared logic
codinglocked
Sign up to unlock
Rules of Hooks - hook in an event handler
codinglocked
Sign up to unlock
Rules of Hooks - hook after an early return
codinglocked
Sign up to unlock