JS Guide
Home
Questions
Topics
Companies
Resources
Bookmarks
Search
Toggle theme
Open menu
Home
Questions
Search
Progress
Home
Topics
react
react
React components, hooks, patterns, and best practices
20
All
7
beginner
6
intermediate
7
advanced
0 of 20 topics read
0%
7 Topics
advanced
Concurrent React
advanced
12 min
Concurrent rendering lets React interrupt and prioritize work — Suspense provides declarative loading states, useTransition marks updates as non-urgent, and useDeferredValue defers expensive re-renders.
Error Boundaries
advanced
10 min
Error boundaries are class components that catch JavaScript errors during rendering and lifecycle methods, displaying a fallback UI instead of crashing the entire app — but they don't catch errors in event handlers, async code, or SSR.
React Internals
advanced
12 min
React's reconciliation algorithm diffs virtual DOM trees in O(n) using two heuristics — different element types tear down the subtree, same types compare attributes — while the Fiber architecture makes this work interruptible so the browser stays responsive during large updates.
Advanced Patterns
advanced
15 min
React patterns evolved from mixins to HOCs to render props to hooks — compound components share implicit state for flexible APIs, while custom hooks have replaced most logic-sharing patterns.
Performance Optimization
advanced
12 min
React.memo skips re-renders when props haven't changed, useMemo caches computed values, and useCallback caches function references — but these are targeted optimizations, not defaults for every component.
Security
advanced
12 min
JSX auto-escapes values to prevent XSS by default, but dangerouslySetInnerHTML, href='javascript:', and localStorage token storage are common vulnerability vectors that require explicit mitigation.
State Management
advanced
18 min
Redux provides predictable state with a single store, actions, and reducers (RTK simplifies this with createSlice). Zustand offers a lighter alternative. Choose based on app complexity — most apps can start with useState + Context.