Recall & Review
beginner
What is a React component?
A React component is a small, reusable piece of code that controls part of the user interface. It can show content and handle user actions.
Click to reveal answer
beginner
What are the two main types of React components?
The two main types are functional components and class components. Functional components use functions and hooks, while class components use classes (less common now).Click to reveal answer
beginner
Why do we use components in React?
Components help break the UI into small, manageable parts. This makes code easier to read, reuse, and maintain, like building with Lego blocks.
Click to reveal answer
beginner
How does a React component render content?
A React component returns JSX, which looks like HTML. React then shows this on the screen as part of the webpage.
Click to reveal answer
beginner
What is a functional component example in React?
Example: function Hello() { return <h1>Hello, friend!</h1>; } This shows a heading with text on the page.Click to reveal answer
What does a React component mainly do?
✗ Incorrect
React components are used to display parts of the user interface.
Which syntax is used inside React components to describe UI?
✗ Incorrect
JSX is a syntax that looks like HTML and is used inside React components to describe UI.
Which React component type is recommended for new code?
✗ Incorrect
Functional components with hooks are the modern recommended way to write React components.
Why are components compared to Lego blocks?
✗ Incorrect
Components are like Lego blocks because they let you build UI from small, reusable parts.
What does a functional React component return?
✗ Incorrect
Functional components return JSX, which React uses to display the UI.
Explain what a React component is and why it is useful.
Think about how you build a webpage from small parts.
You got /4 concepts.
Describe the difference between functional and class components in React.
Focus on how the component is written and used today.
You got /4 concepts.