React Tutorial menu

React Quiz

Check what you have learned in this React tutorial. Answer each question, then read the explanation.

How to Use This Quiz

  • Try every question without looking back at the lessons
  • If you get one wrong, open the lesson it comes from and read that part again
  • Write the code examples yourself in your Vite project to remember them better
TopicLesson
JSX and componentsJSX, Components
Props and eventsProps, Events
Lists and conditionsConditional Rendering, Lists
HooksuseState, Forms, useEffect

Quiz Questions

Exercise

Which command creates a new React project with Vite?

Exercise

What is wrong with this JSX: return <h1>Hi</h1><p>Text</p>;

Exercise

How do you show the value of a variable called price inside JSX?

Exercise

Can a child component change the props it receives?

Exercise

What does {items.length > 0 && <List />} render when items is empty?

Exercise

Why do list items rendered with map() need a key prop?

Exercise

Which is the correct way to add an item to an array in state?

Exercise

What must you call in a form's onSubmit handler to stop the page reloading?

Exercise

What is the cleanup function of useEffect used for?

Finished? Build a small project on your own, such as a to-do list or a product page for a shop. Real practice is the fastest way to learn React.

Learn React with a teacher

Join the Full Stack Development course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp