โ† All React Flashcard Decks

Components Flashcards

6 cards from real React practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Components flashcards as text
  1. What is a React component?

    Answer: A reusable piece of UI that can accept inputs (props) and return JSX describing what should appear on screen

    Components are the building blocks of React applications, encapsulating UI logic and presentation into reusable, independent pieces.

  2. What is the difference between a functional and class component?

    Answer: Functional components are functions that return JSX; class components extend React.Component with a render method

    Functional components are simpler JavaScript functions. With hooks, they have the same capabilities as class components, which is why they are now preferred.

  3. What are props in React?

    Answer: Read-only inputs passed from parent to child components to configure their behavior and display

    Props (properties) flow down from parent to child components, allowing parents to pass data and callbacks to customize child behavior.

  4. What is JSX?

    Answer: A syntax extension that looks like HTML but is actually JavaScript, used to describe UI structure in React

    JSX combines HTML-like syntax with JavaScript, making it easy to write UI code that describes what the rendered output should look like.

  5. What is the virtual DOM?

    Answer: A lightweight JavaScript representation of the real DOM that React uses to efficiently determine what needs to change

    React keeps a virtual copy of the DOM in memory. When state changes, it compares the virtual DOM to the real DOM and updates only what changed (reconciliation).

  6. What is component composition in React?

    Answer: Building complex UIs by combining simpler components together, passing children and props

    Composition means building complex components by combining simpler ones, rather than using inheritance. This is React's primary pattern for code reuse.

Written and edited by , founder of Practice Test Geeks, with AI assistance. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Editorial policy