Home / Skill tests / React

React test: 24 questions to check yourself

In plain words: React is the most widely used toolkit for building website screens out of small reusable parts called components. Answer 24 questions, press the button, and see which you got right, why, and your score by topic.

5,868 open jobs name React today, with a median advertised pay of $200K. 24 questions from beginner to advanced, about 10 to 15 minutes, the kind that come up in interviews.

1What is a React component? Beginner · Components
2What is JSX? Beginner · JSX
3How does a parent component pass data to a child? Beginner · Props
4Can a child component change the props it receives? Beginner · Props
5What does useState return? Beginner · State
6What is wrong with <button onClick={save()}>? Beginner · Events
7Why does React ask for a key on every item of a list? Beginner · Lists and keys
8When does a component run again (render)? Beginner · Rendering
9A click handler runs setCount(count + 1) three times in a row. By how much does count rise after the next render? Intermediate · State
10How should you add an item to a list kept in state? Intermediate · State
11What does useEffect(fn, []) with an empty dependency list do? Intermediate · Effects
12What is the function that an effect returns used for? Intermediate · Effects
13An effect reads userId, but the dependency list leaves it out. What can go wrong? Intermediate · Effects
14Why must hooks not be called inside an if or a loop? Intermediate · Hooks rules
15What makes an input “controlled”? Intermediate · Forms
16What is Context for? Intermediate · Context
17When is useRef a better fit than useState? Intermediate · Refs
18Why is an item’s array index a poor key in a list that can be reordered? Intermediate · Lists and keys
19What is a custom hook? Intermediate · Custom hooks
20When is useReducer a better choice than useState? Intermediate · Reducers
21What does React.memo do? Advanced · Performance
22A component wrapped in React.memo still renders every time. Its parent passes onSave={() => save(id)}. Why? Advanced · Performance
23An effect with no dependency list calls setState with a new value every time. What happens? Advanced · Effects
24In development, an effect runs twice when the component first appears in StrictMode. Why? Advanced · Effects

Questions about this test

How do I prepare for a React interview?
Work through realistic questions, read why each answer is right, then redo the ones you missed. This test has 24, from beginner to advanced, of the kind interviewers commonly ask. Then read the postings: the 5,868 open jobs that name React show what employers expect on top of it.
Is this React test free?
Yes. It needs no account and no email, runs in your browser and sends nothing anywhere.
What does my score mean?
It is a self-check. 80% or more right means the basics are fresh; half to 80% means a good base with gaps; under half means more practice first. The result also shows your score by topic, so you know what to study. It is not an official certificate.
How can I test my React skills?
Build a small app of your own, such as a to-do list that loads its items from a server: split it into components, keep the form in state, load data in an effect with a cleanup, and explain why each piece of state lives where it does. Then take this test and read the explanation for every answer you miss.
Is React hard to learn?
The basics (components, props, state and events) come quickly if you know JavaScript. The parts that hiring tests go deeper on are effects and their dependency lists, keys, when components render again, and how to keep a large app’s state simple.
What is the difference between props and state?
Props are inputs a component receives from its parent and may not change. State is data a component owns and can change with its setter function, and each change makes React draw the component again.
What do employers expect from a React developer?
Solid JavaScript first, then components, hooks, handling forms and loading data, and usually TypeScript and a way to test components. The postings on this site list the other skills asked for next to React.

More tests: SQL Excel Python JavaScript Linux Docker All tests