Frontend Developer
React questions
141 questions on React for frontend developers, easiest first.
Easy 40
- Why React lists need keyseasy
- Input that ignores typingeasy
- Changing a prop inside a childeasy
- What JSX turns intoeasy
- A component written in lowercaseeasy
- Adding a CSS class in JSXeasy
- Returning two elementseasy
- A stray 0 on the pageeasy
- Handler that runs on every rendereasy
- Content between component tagseasy
- Logging state right after setting iteasy
- Two siblings that share a valueeasy
- Changing the initial state propeasy
- Rendering a list of citieseasy
- A form that reloads the pageeasy
- Inline styles in JSXeasy
- Hiding a componenteasy
- Logs that appear twiceeasy
- When useEffect runseasy
- An effect with an empty arrayeasy
- When effect cleanup runseasy
- Focusing an input on a button clickeasy
- Reading the current languageeasy
- What useMemo is foreasy
- What useCallback returnseasy
- Finding which component is sloweasy
- Splitting off a heavy admin pageeasy
- Finding a button in a testeasy
- Asserting an error is goneeasy
- Starting a new React projecteasy
- Why use a data-fetching libraryeasy
- A secret key in import.meta.enveasy
- State hooks in a server-only fileeasy
- Raw text in React Nativeeasy
- Showing 5,000 contacts in React Nativeeasy
- Choosing the selected optioneasy
- A name containing a script tageasy
- Starting a new React Native appeasy
- Linking a label in JSXeasy
- Showing rupees in Indian formateasy
Medium 56
- Stale value in useEffectmedium
- Multiple setState callsmedium
- Ref value not shown on screenmedium
- Resize handler that runs many timesmedium
- Syncing derived values with an effectmedium
- Form keeps the previous user datamedium
- Changing an object in statemedium
- Adding to a list in statemedium
- Removing a row from statemedium
- Expensive initial statemedium
- An input that loses focus on each keymedium
- Two counters that share statemedium
- Uncontrolled to controlled warningmedium
- Same key in two different listsmedium
- Passing a prop through five layersmedium
- When to reach for useReducermedium
- State becomes undefined after an actionmedium
- A button inside a clickable cardmedium
- Children re-render with the parentmedium
- A hook inside an ifmedium
- Two components using one custom hookmedium
- Unique ids for a reusable fieldmedium
- useFormStatus always says not pendingmedium
- Showing a form action’s resultmedium
- Default prop valuesmedium
- When React onChange firesmedium
- An effect that re-runs on every rendermedium
- useMemo that recomputes every timemedium
- useCallback that changes nothingmedium
- A slow page from one hover statemedium
- Exposing only focus() from a componentmedium
- Cleaning up a window listener in an effectmedium
- Rendering 20,000 rowsmedium
- Where to split a bundle firstmedium
- A Server Component inside a client wrappermedium
- Security of a Server Functionmedium
- staleTime versus gcTimemedium
- Wrong orders shown for a new filtermedium
- userEvent versus fireEventmedium
- Testing text that appears after a fetchmedium
- The "not wrapped in act" warningmedium
- A store hook that re-renders too oftenmedium
- What the React Compiler doesmedium
- A tab switch that freezes the pagemedium
- dispatch in a dependency arraymedium
- The memo compare functionmedium
- Flexbox defaults in React Nativemedium
- Different code for iOS and Androidmedium
- Sharing logic: hook or HOCmedium
- What a render prop ismedium
- Building <Tabs> with <Tabs.Tab>medium
- Supporting both controlled and uncontrolledmedium
- Where focus goes after a modalmedium
- A big form that re-renders on each keymedium
- Filters lost on refreshmedium
- A list that stops updatingmedium
Hard 45
- Cause of a hydration mismatchhard
- Race condition in data fetchinghard
- Why React.memo did not helphard
- Every context consumer re-rendershard
- Effect that fetches foreverhard
- Tooltip flashes in the wrong placehard
- Typing lags while a big list filtershard
- Optimistic like button done righthard
- Batching inside a timeouthard
- Scrolling to a just-added messagehard
- Too many re-renders errorhard
- Resetting selection when items changehard
- Setting state to the same valuehard
- Items added twice in developmenthard
- A list item made of two elementshard
- Old value after an awaithard
- use() that suspends foreverhard
- Errors an error boundary misseshard
- Which fallback showshard
- Clicks inside a portalhard
- Passing a ref to a function componenthard
- Cleanup from a ref callbackhard
- useContext with no Provider abovehard
- useEffect(async () => ...)hard
- Two socket connections in developmenthard
- Relying on useMemo for correctnesshard
- Logging the latest theme from an effecthard
- Streaming HTML with Suspensehard
- Passing onSelect from a Server Componenthard
- Putting a function in useStatehard
- Analytics event sent many timeshard
- Reading a mutable store during renderhard
- A transition around typinghard
- One user lookup per requesthard
- Old content during a product changehard
- A huge bundle from one helperhard
- Mocking APIs in component testshard
- Heavy work in useLayoutEffecthard
- Jumping to row 3,000 in a FlatListhard
- Animation stutters while data loadshard
- A custom hook with a stale callbackhard
- Loading and error both truehard
- One slow field in a big formhard
- A user-supplied website linkhard
- Organising a growing React codebasehard