React & Next.js: Hooks, Patterns & Server Components
100 cards · 🇺🇸 English
React hooks and patterns plus Next.js routing and server components.
Study all 100 cards for free
Flashcards, quizzes, pixel-art games and a daily review that remembers for you.
Try the first 10 cards
1 / 10UseState
Tap the card for the answer · swipe right if you knew it, left if not
Already have an account? Sign in
Cards
- 1UseStateA state hook that declares a state variable that you can update directly
- 2UseReducerA state hook that declares a state variable with the update logic inside a reducer function
- 3Purpose of state in ReactState lets a component 'remember' information like user input
- 4UseContextA context hook that reads and subscribes to a context
- 5Context allow a component toReceive information from distant parents without passing it as props
- 6UseRefA ref hook that declares a ref. You can hold any value in it, but most often it's used to hold a DOM node
- 7Main difference between refs and stateUnlike with state, updating a ref does not re-render your component
- 8UseImperativeHandleA ref hook that lets you customize the ref exposed by your component. This is rarely used
- 9UseEffectAn effect hook that connects a component to an external system
- 10Effects allow a component toConnect to and synchronize with external systems, including network, browser DOM, animations, widgets, and other non-React code
- 11UseLayoutEffectA variation of useEffect that fires before the browser repaints the screen. You can measure layout here
- 12UseInsertionEffectA variation of useEffect that fires before React makes changes to the DOM. Libraries can insert dynamic CSS here
- 13UseEffectEventA hook that creates a non-reactive event to fire from any Effect hook
- 14UseMemoA performance hook that lets you cache the result of an expensive calculation
- 15UseCallbackA performance hook that lets you cache a function definition before passing it down to an optimized component
- 16UseTransitionA performance hook that lets you mark a state transition as non-blocking and allow other updates to interrupt it
- 17UseDeferredValueA performance hook that lets you defer updating a non-critical part of the UI and let other parts update first
- 18UseDebugValueA hook that lets you customize the label React DevTools displays for your custom Hook
- 19UseIdA hook that lets a component associate a unique ID with itself. Typically used with accessibility APIs
- 20UseSyncExternalStoreA hook that lets a component subscribe to an external store
- 21UseActionStateA hook that allows you to manage state of actions
- 22Refs described as in ReactAn 'escape hatch' from the React paradigm, useful when you need to work with non-React systems
- 23Common way to optimize re-rendering performanceSkip unnecessary work by reusing cached calculations or skipping re-renders if data hasn't changed since previous render
- 24What type of updates should use useTransition?Non-blocking updates that can be interrupted by other updates, separating them from synchronous blocking updates
- 25Typical use case for useIdAssociating a unique ID with a component, typically used with accessibility APIs
- 26Can you define your own custom Hooks in React?Yes, you can define your own custom Hooks as JavaScript functions
- 27Syntax pattern for useStateconst [value, setValue] = useState(initialValue)
- 28Syntax pattern for useEffectuseEffect(() => { /* effect code */ return () => { /* cleanup */ } }, [dependencies])
- 29What should useEffect return?A cleanup function that runs when the component unmounts or before the effect runs again
- 30Dependency array in useEffectAn array of values that determines when the effect should re-run. The effect runs when any dependency changes
And 70 more cards. Study the whole deck free
Articles about this deck
More Programming decks
See all- 🌐
APIs: REST, GraphQL & HTTP Status Codes
108 cards · 🇺🇸 English
REST and GraphQL API concepts plus common HTTP status codes.
- 🎨
CSS: Box-Modell, Selektoren & Media Queries
129 cards · 🇺🇸 English
Das CSS-Box-Modell, Selektortypen, Media Queries und Animationen.
- 📄
HTML : balises et attributs
99 cards · 🇺🇸 English
Éléments HTML essentiels et leurs attributs.
- 🎨
CSS: Box Model, Selectors & Media Queries
129 cards · 🇺🇸 English
The CSS box model, selector types, media queries, and animations.
- 🔒
Web Security: OWASP & Authentication
35 cards · 🇺🇸 English
Common web vulnerabilities (OWASP Top 10) and authentication concepts.
- 🎨
CSS : Flexbox et Grid
58 cards · 🇺🇸 English
Mise en page avec CSS Flexbox et Grid.
