React interview cheat sheet
Rendering, hooks, state, performance, patterns and React 18/19
React interviews check whether you understand how React decides what to render and when: state snapshots, re-render triggers, reconciliation and keys, and the rules of hooks. Then they move to effects, memoization, state management, React 18 concurrency and the React 19 Actions APIs. JSX examples are illustrative; the plain-JS snippets simulate the logic (batching, stale closures, reducers) and are verified. Read the 15-minute revision, then use Quiz mode and answer out loud.
15-minute revision
- A component is a pure function of props + state + context that returns JSX. Rendering must have no side effects; side effects go in event handlers or effects.
- A component re-renders when its state changes, its parent re-renders, or a context it reads changes. Props changing alone is not a trigger; the parent re-rendering is.
- State is a snapshot per render.
setXschedules a new render; it does not changexin the current one. UsesetX(prev => ...)when the next value depends on the previous. - React 18+ batches automatically everywhere (events, timeouts, promises). Many
setStatecalls in one tick cause one render. - Reconciliation: different element type at the same position = destroy and rebuild the subtree; same type = update props and recurse. Children lists are matched by key.
- Keys must be stable and unique among siblings. Index keys break state when items are inserted, removed or reordered. Changing a key on purpose resets a component.
- Rules of hooks: call them only at the top level of components or custom hooks, never in loops, conditions or after an early return. React tracks hooks by call order. (
use()is the one exception that can be conditional.) useEffectruns after paint;useLayoutEffectruns after DOM mutation but before paint. Return a cleanup function; it runs before the next effect and on unmount.- Strict Mode in development double-invokes component bodies and runs effects mount → cleanup → mount to expose impure code and missing cleanups.
useRefholds a mutable.currentthat survives renders and does not trigger a render when changed. Use it for DOM nodes, timers and previous values.useMemocaches a value,useCallbackcaches a function,React.memoskips re-rendering a component when props are shallowly equal. They are optimisations, not guarantees. React Compiler (v1.0, Oct 2025) can add them automatically.- Context is for passing values deeply, not a full state manager: every consumer re-renders when the value changes. Redux/Zustand add selectors, devtools and middleware.
- React 18:
createRoot, concurrent rendering,useTransition(mark updates non-urgent),useDeferredValue(lag a value), streaming SSR with Suspense. - React 19: Actions (async functions in transitions),
useActionState,useOptimistic,useFormStatus,use(),refas a normal prop,<Context>as provider, Server Components and Server Functions. - Error boundaries are still class components (
getDerivedStateFromError+componentDidCatch); they do not catch errors in event handlers or async code. - RTL philosophy: test what the user sees. Prefer
getByRole, usefindBy*for async UI,queryBy*to assert absence, anduser-eventfor interactions.
Core concepts
Virtual DOM, declarative UI & JSX
You describe what the UI should look like for a given state; React works out the minimal DOM changes.
- React is a library for building UIs from components. It is declarative: you write
UI = f(state)and React keeps the DOM in sync. - The virtual DOM is a tree of plain JS objects (React elements) describing the UI. On each update React builds a new tree, compares it to the old one and applies only the differences to the real DOM.
- The virtual DOM is not “faster than the DOM”. Its value is that you can re-render declaratively and React batches and minimises the real DOM work for you.
- JSX is syntax sugar. A compiler (Babel, SWC, esbuild, TypeScript) turns
<div className="a">hi</div>intojsx('div', { className: 'a', children: 'hi' })with the automatic runtime (React 17+), so you no longer needimport React. - JSX rules: one root element (or a
<>Fragment</>), close every tag,classNameandhtmlFor, camelCase attributes, and{}for any JS expression (not statements). - JSX escapes embedded strings by default, which protects against XSS.
dangerouslySetInnerHTMLturns that off.
Interview questions
- What is the virtual DOM and why does React use it?
- Is the virtual DOM faster than direct DOM manipulation?
- What does JSX compile to?
Components, props, state & lifting state
Props flow down and are read-only; state is private memory. Shared state lives in the closest common parent.
- Function components are the standard. Class components still work but are legacy, except for error boundaries.
- Props are inputs from the parent. They are read-only: never mutate them.
childrenis a prop too. - State is data a component owns and changes over time. Updating it with the setter schedules a re-render of that component and its children.
- One-way data flow: data goes down via props, events go up via callback props (
onChange,onSelect). - Do not store what you can derive during render (full name from first + last, filtered list from list + query). Duplicated state drifts out of sync.
- Component names must start with a capital letter; lowercase tags are treated as HTML elements.
- Lifting state up: when two siblings need the same data, move the state to their nearest common parent and pass it down with setter callbacks.
- Keep state as low as possible but as high as necessary. Too high causes needless re-renders; too low causes duplication.
- Lists:
items.map(item => <Row key={item.id} {...} />). Filter/sort before mapping, ideally derived during render. - Conditionals:
cond && <X/>,cond ? <A/> : <B/>, earlyreturn null, or a lookup object for many cases. &&with a number is a trap:{count && <Badge/>}renders0. Usecount > 0 &&.- Fragments group siblings without an extra DOM node; use
<Fragment key={id}>when a list item renders several elements.
Interview questions
- Difference between props and state?
- Function vs class components?
- What is derived state and why avoid storing it?
- What does “lifting state up” mean?
- Why does
{items.length && <List/>}sometimes show 0?
Rendering & re-render triggers
Trigger → render (call components) → commit (touch the DOM). A parent render re-renders all its children by default.
- Trigger: the initial
root.render(), or a state update (setState,dispatch, context change,useSyncExternalStorechange). - Render phase: React calls your component functions to get new JSX and diffs it. This must be pure and can be paused, repeated or thrown away in concurrent mode.
- Commit phase: React applies DOM changes, sets refs, then runs layout effects synchronously and passive effects (
useEffect) after paint. - When a component renders, all its descendants render too, regardless of props, unless they are memoised (
React.memo) and their props are equal. - If you set state to a value that is
Object.is-equal to the current one, React bails out and skips the children. - Rendering is not the same as updating the DOM. A render whose output did not change commits nothing.
Interview questions
- When does a React component re-render?
- Why does mutating state not update the UI?
- How do you stop a child re-rendering when its parent re-renders?
Reconciliation & keys
React diffs trees in O(n) using two rules: element type and key. Keys tell React which child is which.
- A full tree diff is O(n³). React uses a heuristic O(n) algorithm based on two assumptions.
- Rule 1: elements of different types produce different trees.
<div>→<span>or<A>→<B>unmounts the old subtree (state lost) and mounts a new one. - Rule 2: for the same type, React keeps the DOM node / component instance and only updates changed props, then recurses into children.
- For lists, React matches children by key. Without keys (or with index keys) it matches by position.
- State is tied to a position in the tree, not to the component function. Same component at the same position keeps its state.
- Giving a component a new key forces a remount, a clean way to reset a form when the selected user changes:
<Profile key={userId} />.
Interview questions
- What is reconciliation?
- Why are keys needed, and why is the index a bad key?
- What happens if you change a component's key?
Fiber architecture
Fiber is React's internal reimplementation (React 16) that splits rendering into small units of work that can be paused, prioritised and resumed.
- Before Fiber, the stack reconciler rendered recursively and synchronously; a big update blocked the main thread until done.
- A fiber is a JS object for one component or host node:
type,key,props,stateNode, the hooks linked list (memoizedState), effect flags, andchild/sibling/returnpointers. - The linked-list shape lets React walk the tree with a loop instead of recursion, so it can stop after any unit of work and yield to the browser.
- Double buffering: there is a
currenttree (on screen) and aworkInProgresstree being built. On commit React swaps them. - Lanes are bit flags for priority: a click (sync/discrete) beats a transition, which beats offscreen work. Higher-priority updates can interrupt lower ones.
- Fiber is what makes concurrent features possible: Suspense, transitions,
useDeferredValue, streaming SSR and selective hydration.
Interview questions
- What is React Fiber?
- What are the current and work-in-progress trees?
Hooks
Rules of hooks & custom hooks
Hooks are matched by call order, so call them unconditionally at the top level; package reusable hook logic in use-prefixed custom hooks.
- Rule 1: call hooks only at the top level: not inside conditions, loops, nested functions,
try/catch, or after an earlyreturn. - Rule 2: call hooks only from React function components or custom hooks (names starting with
use), not from regular functions or classes. - Why: React stores hook data in a list on the fiber. On each render the Nth hook call reads the Nth slot. Skipping a call shifts every slot after it.
eslint-plugin-react-hooksenforces the rules andexhaustive-depschecks dependency arrays. Treat its warnings as bugs.use()(React 19) is the exception: it can be called inside conditions and loops, but still only inside a component or hook.- A custom hook is a normal function whose name starts with
useand which calls other hooks. - It shares logic, not state. Two components calling
useOnlineStatus()each get their own state. - Good candidates: subscriptions (
useWindowSize), data fetching (useFetch), form logic,useDebounce,useLocalStorage,usePrevious. - Return whatever shape fits: a value, a tuple
[value, setValue], or an object. - They replaced HOCs and render props for most logic reuse, because they don't add wrapper components or naming collisions.
Interview questions
- What are the rules of hooks?
- Why can't hooks be called conditionally?
- What is a custom hook and why use one?
- Do two components using the same custom hook share state?
useState: snapshots, batching & functional updates
setX queues an update for the next render; use the updater form when the new value depends on the old.
const [value, setValue] = useState(initial). The initial value is used only on the first render.- Lazy initialiser:
useState(() => expensive())runs the function only once.useState(expensive())calls it on every render and throws the result away. - State is a snapshot: inside one render,
countis a constant. CallingsetCount(count + 1)three times adds 1, not 3. - Updater function:
setCount(c => c + 1)receives the latest queued value, so three calls add 3. - Batching: React groups all updates from one event (and in React 18+, from timeouts, promises and native handlers too) into one render.
flushSyncforces an immediate render if you really need it. - Objects and arrays must be replaced, not mutated:
setUser({ ...user, name }),setList(l => l.filter(...)).
Interview questions
- Why does
console.log(count)aftersetCount(count + 1)print the old value? - When should you use the functional updater form?
- What is automatic batching in React 18?
- How do you update one field in a nested state object?
useEffect: dependencies, cleanup & Strict Mode
Effects synchronise a component with an external system after render; dependencies decide when they re-run.
useEffect(setup, deps)runs after the commit and usually after paint. Use it for subscriptions, network requests, timers, and non-React widgets.- Dependencies: no array = after every render;
[]= after mount only;[a, b]= whenaorbchanges (compared withObject.is). - Cleanup: the function returned from setup runs before the effect re-runs with new deps and on unmount. Unsubscribe, clear timers, abort fetches.
- Every reactive value used inside (props, state, functions defined in the component) must be in the deps. Do not silence the lint rule; restructure instead.
- Strict Mode (dev only) runs an extra setup → cleanup → setup cycle on mount to prove your cleanup works. If the second run breaks things, the effect is missing cleanup.
- You often don't need an effect: derive values during render, handle user actions in event handlers, reset state with a
key, and fetch with a framework or a library (TanStack Query) where possible.
Interview questions
- Why does my effect run twice in development?
- How do you avoid race conditions when fetching in an effect?
- What is a stale closure in hooks?
- Name cases where you don't need
useEffect.
useLayoutEffect & useRef
useLayoutEffect runs before paint for measuring DOM; useRef is a mutable box that persists across renders without re-rendering.
useLayoutEffectfires synchronously after DOM mutations, before the browser paints. Use it to measure layout (size, position) and adjust before the user sees a flicker, e.g. tooltip positioning.- It blocks painting, so prefer
useEffectunless you see a visual glitch. It does nothing during server rendering. useRef(initial)returns{ current }. The same object is returned every render. Changing.currentdoes not trigger a render.- Uses: DOM access (
<input ref={inputRef} />), storing timer ids, previous values, the latest callback, or instance-like variables. - Do not read or write
ref.currentduring render (except lazy init); it makes render impure. Do it in effects or handlers. - Ref callbacks:
ref={node => {...}}runs when the node attaches. In React 19 a ref callback can return a cleanup function.
Interview questions
- Difference between
useEffectanduseLayoutEffect? - Difference between
useRefanduseState? - How do you get the previous value of a prop?
useMemo, useCallback & React.memo
Cache values, functions and component output between renders to skip work, but only when it measurably helps.
useMemo(() => compute(a, b), [a, b])caches a value until a dep changes.useCallback(fn, [deps])caches a function reference. It equalsuseMemo(() => fn, deps).React.memo(Component)skips re-rendering when every prop is shallowly equal (Object.is) to last time. An optional second argument is a custom compare.- They work together:
React.memois useless if the parent passes a new object or arrow function each render;useCallback/useMemokeep those references stable. - Memoisation costs memory and comparisons. Use it for expensive calculations, props to memoised children, and values used as effect dependencies.
- React Compiler (stable v1.0, October 2025) memoises components and values automatically at build time, making most manual
useMemo/useCallbackunnecessary in new code.
Interview questions
- Difference between
useMemoanduseCallback? - Difference between
React.memoanduseMemo? - Why doesn't my
React.memocomponent skip renders? - What is React Compiler?
useContext & useReducer
Context passes data through the tree without prop drilling; useReducer centralises complex state transitions in a pure function.
const Ctx = createContext(default). Provide with<Ctx value={v}>(React 19) or<Ctx.Provider value={v}>(older, still works). Read withuseContext(Ctx)oruse(Ctx).- The default value is used only when there is no provider above.
- Every component that reads the context re-renders when the provider's
valuechanges (Object.is). Passingvalue={{ user, setUser }}inline creates a new object every render; memoise it. - Split contexts by update frequency (e.g. state context and dispatch context) to reduce re-renders.
useReducer(reducer, initialArg, init?)returns[state, dispatch]. The reducer(state, action) => newStatemust be pure and return new objects.dispatchhas a stable identity, so it is safe to pass down or omit from deps. Context + reducer is a common lightweight “store” for medium apps.
Interview questions
- What is prop drilling and how do you avoid it?
- When do context consumers re-render?
- When would you choose
useReduceroveruseState?
Building UIs
Controlled vs uncontrolled inputs & forms
Controlled inputs take their value from state; uncontrolled inputs keep it in the DOM and you read it when needed.
- Controlled:
value={text}+onChange={e => setText(e.target.value)}. React state is the single source of truth. Enables live validation, formatting and conditional UI. - Uncontrolled:
defaultValue+ aref, or readFormDataon submit. Less code and fewer renders. - Checkboxes use
checked/defaultChecked. File inputs are always uncontrolled. - Switching an input from
undefinedvalue to a defined one triggers the “uncontrolled to controlled” warning. Initialise with''. - React 19:
<form action={fn}>callsfn(formData)on submit, inside a transition, and resets uncontrolled fields after success. - Large forms: libraries like React Hook Form (uncontrolled, few renders) plus a schema validator (Zod).
Interview questions
- Difference between controlled and uncontrolled components?
- What does the “changing an uncontrolled input to be controlled” warning mean?
- How do forms work in React 19?
Context vs Redux vs Zustand (state management)
Pick by state type: server cache, URL, local UI or shared client state. Context is transport; Redux/Zustand are stores with selectors.
- Classify state first: server state (fetched data) → TanStack Query / SWR / RTK Query; URL state → router search params; form state → form library; local UI state →
useState. - Context has no selectors; any value change re-renders all consumers. Fine for low-frequency values: theme, auth user, locale.
- Redux Toolkit (the recommended way to write Redux): one store, slices with reducers (Immer inside),
useSelectorsubscribes to a slice, strong devtools (time travel) and middleware. Best for large teams and complex flows. - Zustand: a tiny hook-based store, no provider needed, selectors to limit re-renders, minimal boilerplate.
- Others: Jotai/Recoil-style atoms for fine-grained state; MobX for observable/reactive style.
- Store libraries connect to React via
useSyncExternalStore, which avoids tearing under concurrent rendering.
Interview questions
- Is Context a replacement for Redux?
- Redux vs Zustand?
- How would you structure state for a large dashboard app?
Routing, code splitting & Suspense
React Router maps URLs to components without reloads; lazy() + <Suspense> load route code on demand.
const Settings = lazy(() => import('./Settings'))creates a component whose bundle is fetched the first time it renders. The module needs a default export.- Wrap it in
<Suspense fallback={<Spinner/>}>. The nearest Suspense boundary shows the fallback while the code loads. - Split by route first (biggest win), then heavy widgets: charts, editors, modals.
- Suspense also works for data with Suspense-enabled sources:
use(promise), framework loaders, TanStack Query's suspense mode. It does not detect fetching insideuseEffect. - Declare
lazyat module level, never inside a component, or the state resets every render. - Updates inside a transition don't replace already visible content with a fallback; React keeps the old UI until the new one is ready.
- React Router v7 ships as the single
react-routerpackage (it merged with Remix). It can be used as a library (declarative / data mode) or as a framework (Vite plugin, file routes, SSR). - Declarative mode:
<BrowserRouter>,<Routes>,<Route path element>,<Link>,<NavLink>,<Outlet>for nested layouts. - Hooks:
useParams(/users/:id),useNavigate(programmatic navigation),useLocation,useSearchParams(query string state). - Data mode:
createBrowserRouter+RouterProvider, with loaders (fetch before render) and actions (handle form submissions) per route. - Protect routes with a wrapper that checks auth and renders
<Navigate to="/login" replace />. - Combine with
lazy()for route-based code splitting.
Interview questions
- What is code splitting and how do you do it in React?
- How does Suspense work?
- How does client-side routing work?
- How do you implement a protected route?
Advanced rendering
Error boundaries & portals
Error boundaries catch render errors in a subtree and show a fallback; portals render children into another DOM node while keeping React context and events.
- An error boundary is a class component with
static getDerivedStateFromError(render fallback) and/orcomponentDidCatch(error, info)(log). - It catches errors thrown while rendering, in lifecycle methods and in constructors of children. It does not catch errors in event handlers, async code (
setTimeout, promises), SSR, or in itself. - Without a boundary, an uncaught render error unmounts the whole root. In React 19,
createRootacceptsonCaughtError,onUncaughtErrorandonRecoverableErrorfor reporting. - The community
react-error-boundarypackage gives a function-friendly<ErrorBoundary>with reset support. createPortal(children, domNode)renders children into a different DOM node (modals, tooltips, toasts) to escapeoverflow: hiddenandz-indexstacking.- Portal content stays in the React tree: it gets context, and events bubble through React ancestors, not DOM ancestors.
Interview questions
- What is an error boundary and what can't it catch?
- Why are error boundaries still class components?
- What is a portal and how do events behave?
React 18: concurrent rendering, transitions & deferred values
Concurrent rendering lets React prepare updates in the background and interrupt them for urgent input; transitions mark which updates can wait.
createRoot(el).render(<App/>)enables React 18+ features. LegacyReactDOM.renderwas removed in React 19.- Concurrent rendering means rendering is interruptible. React can work on a low-priority update, pause for a keystroke, then continue or discard the work.
const [isPending, startTransition] = useTransition(). Updates insidestartTransitionare non-urgent: typing stays responsive and already-shown content is not replaced by Suspense fallbacks.useDeferredValue(value)returns a value that lags behind during urgent updates. Use it when you don't own the setter (e.g. a prop) to render an expensive list with the old value first.- Also new in 18: automatic batching everywhere,
useId(stable ids for SSR/a11y),useSyncExternalStore,useInsertionEffect(CSS-in-JS), and streaming SSR with selective hydration. - Transitions are not debouncing: no fixed delay; React renders as soon as it can and abandons stale renders.
Interview questions
- What is concurrent rendering?
- Difference between
useTransitionanduseDeferredValue? - How is
startTransitiondifferent from debouncing?
React 19: Actions, use(), Server Components & Compiler
React 19 adds Actions for async mutations, useActionState/useOptimistic/use(), ref as a prop, and stable Server Components; React Compiler auto-memoises.
- Actions: async functions passed to
startTransitionor to<form action>. React tracks pending state, handles errors with boundaries, and supports optimistic updates. useActionState(action, initialState)→[state, dispatchAction, isPending]. The action receives(previousState, payload)and its return value becomes the new state (great for form results and errors).useOptimistic(value, reducer?)→[optimisticState, setOptimistic]: show the expected result immediately while an Action runs; it falls back to the real value when the Action finishes.useFormStatus()(fromreact-dom) gives{ pending, data, method, action }of the parent<form>without prop drilling.use(resource)reads a promise (suspends until resolved) or a context. Unlike hooks, it may be called conditionally.- Quality of life:
refis a regular prop for function components (forwardRefno longer needed),<Context value>as provider, ref callback cleanups,<title>/<meta>/<link>hoisted to<head>, stylesheet and script support, better hydration error diffs. - Later minors: 19.2 added
<Activity>(hide UI but keep state),useEffectEventand Performance Tracks; 19.3 made<ViewTransition>and Fragment refs stable. - React Server Components (RSC) render ahead of time on the server (at build or per request). Their code and dependencies are never shipped to the browser.
- They can be
asyncand read data directly (DB, file system) without an API layer. They cannot use state, effects, refs, browser APIs or event handlers. 'use client'marks a module boundary: that file and everything it imports become client code. Server Components can render Client Components and pass serialisable props (including JSX as children).- Server Functions (
'use server') are async functions that run on the server but can be called from the client, typically as form actions. Treat them as public endpoints: validate input and check auth. - RSC is stable in React 19 but needs a framework/bundler integration (Next.js App Router, React Router framework mode, Waku, Parcel).
- React Compiler is separate from RSC: a build-time tool that auto-memoises client and server code. Version 1.0 is stable and is enabled by default in some framework templates.
Interview questions
- What are Actions in React 19?
- Explain
useActionState. - How does
useOptimisticwork? - How is
use()different from other hooks? - Difference between Server Components and SSR?
Performance, patterns & testing
Performance & profiling
Measure first with the Profiler, then fix the cause: too many renders, expensive renders, or too much JS.
- React DevTools Profiler records commits and shows which components rendered, how long, and why (enable “Record why each component rendered”). The “Highlight updates” option flashes re-renders.
- The
<Profiler id onRender>component measures render timing in code. React 19.2 adds Performance Tracks in Chrome DevTools' Performance panel. - Fix structure first: move state down, lift content up as children, split big contexts, avoid creating components inside components.
- Then memoise:
React.memo,useMemo,useCallback, or enable React Compiler. - Long lists: virtualise (react-window, TanStack Virtual) to render only visible rows.
- Load less: code splitting, lazy images, smaller dependencies, Server Components; keep input responsive with
useTransition/useDeferredValue. Track Core Web Vitals (LCP, INP, CLS).
Interview questions
- How do you find and fix performance issues in a React app?
- Why does passing
childrenavoid re-renders? - Scenario: a dashboard with 50 widgets re-renders on every WebSocket message. What do you do?
Patterns: HOC, render props & compound components
HOCs and render props were the pre-hooks reuse patterns; compound components share implicit state among related parts.
- Higher-order component (HOC): a function that takes a component and returns an enhanced one (
withAuth(Page), Reduxconnect). Downsides: wrapper hell, prop name collisions, hidden props. - Render props: a component takes a function prop (often
children) and calls it with data:<Mouse>{pos => <Cursor {...pos}/>}</Mouse>. Flexible but nests deeply. - Custom hooks replace both for most logic reuse today. HOCs remain useful for cross-cutting wrappers (auth gates, error boundaries, analytics).
- Compound components: a parent shares state with children through context:
<Tabs><Tabs.List/><Tabs.Panel/></Tabs>. Flexible markup with an implicit API (Radix UI, Headless UI, Reach). - Other patterns: container/presentational (less common since hooks), controlled/uncontrolled component APIs (
valuevsdefaultValue), slots via props, provider pattern.
Interview questions
- HOC vs render props vs custom hooks?
- What are compound components?
- How would you design a reusable, accessible
Dropdowncomponent?
Testing with React Testing Library
Test behaviour the user sees, query by role and text, and interact with user-event, not implementation details.
- Guiding principle: *the more your tests resemble the way your software is used, the more confidence they give you*. Avoid testing state or internal methods.
- Query priority:
getByRole(withname) →getByLabelText→getByPlaceholderText→getByText→getByDisplayValue→ alt/title →getByTestIdas a last resort. - Variants:
getBy*throws if missing (assert presence),queryBy*returnsnull(assert absence),findBy*returns a promise that waits (async UI).*AllBy*for multiple. - Use
@testing-library/user-event(const user = userEvent.setup(); await user.click(btn)) overfireEvent; it simulates full browser interaction sequences. - Matchers from
@testing-library/jest-dom:toBeInTheDocument,toHaveTextContent,toBeDisabled,toHaveValue. - Mock network at the boundary with MSW instead of mocking
fetchor hooks. Runners: Jest or Vitest; Playwright/Cypress for E2E. - Enzyme is not maintained for modern React;
react-test-rendereris deprecated in React 19.
Interview questions
- What is React Testing Library's philosophy?
- Difference between
getBy,queryByandfindBy? - Why prefer
user-eventoverfireEvent? - How do you test a component that fetches data?