🧠 Quiz LESSON 5 OF 18

React Foundations Quiz

⏱️ 10 min
🧠 10 Questions

Check Your React Basics

Ten questions covering JSX, props, and component fundamentals, with full explanations for every answer.

🧠 React Foundations Quiz
Click an option to check your answer. Explanations appear immediately.
10 questions total
Q1. What does JSX compile down to?
A) HTML strings
B) JavaScript function calls
C) CSS rules
D) JSON objects
Q2. Which attribute replaces "class" in JSX?
A) className
B) cssClass
C) class-name
D) styleClass
Q3. What must every list of rendered items include?
A) A className
B) A unique key prop
C) An index.js file
D) A default export
Q4. Props flow in which direction?
A) Child to parent
B) Parent to child
C) Sideways between siblings
D) Both directions equally
Q5. Which command creates a new React project using Vite?
A) npm init react
B) npm create vite@latest
C) npx react-new
D) npm install react-app
Q6. Inside JSX, how do you embed a JavaScript expression?
A) <% expression %>
B) {{ expression }}
C) { expression }
D) [[ expression ]]
Q7. Which of these is true about a functional component?
A) It must extend React.Component
B) It is a function that returns JSX
C) It cannot use hooks
D) It must be a class
Q8. Can a component modify the props it receives?
A) Yes, always
B) No, props are read-only
C) Only numeric props
D) Only if using useState
Q9. What must a JSX expression return?
A) Multiple root elements are fine
B) Exactly one root element (or a Fragment)
C) A string only
D) Nothing, JSX has no return
Q10. What is the Virtual DOM?
A) A backup copy of your database
B) An in-memory representation of the UI React uses to compute efficient updates
C) A CSS framework
D) A browser extension
🎉
🗒 Cheat Sheet 📝 Worksheet