0
0
Reactframework~5 mins

What is a component in React - Quick Revision & Key Takeaways

Choose your learning style9 modes available
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?
ADisplays part of the user interface
BStores data in a database
CRuns server code
DManages network connections
Which syntax is used inside React components to describe UI?
AJSX
BSQL
CCSS
DXML
Which React component type is recommended for new code?
ANeither, use plain JavaScript
BFunctional components
CBoth are equally recommended
DClass components
Why are components compared to Lego blocks?
ABecause they require batteries
BBecause they are colorful
CBecause they are made of plastic
DBecause they build UI in small, reusable pieces
What does a functional React component return?
AA CSS style
BA number
CJSX to show UI
DA database query
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.