Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 1.41 KB

class-01.md

File metadata and controls

23 lines (17 loc) · 1.41 KB

What is a “component”?

A component is like a building block for making web interfaces. It's a piece of code that you can reuse and customize. You can use components to create different parts of a website or application, and they manage their own data and behavior.

What are the characteristics of a component?

React components are reusable, self-contained building blocks for creating user interfaces. They can be combined, manage their own data, respond to user actions, and use props to receive data from other components.

What are the advantages of using component-based architecture?

  • Reuse: Components can be used again and again.
  • Modularity: Code is divided into smaller, manageable parts.
  • Composition: Components can be combined to create complex interfaces.
  • Isolation: Each component manages its own state, making debugging easier.
  • Performance: React's efficient rendering improves application speed.
  • Community: React's popularity means a wealth of resources and tools are available.

What is “props” short for?

"properties".

How are props used in React?

To pass data from the parent to the child component in a unidirectional flow.

What is the flow of props?

Props flow in one direction only, from parent to child. Changes to props in a parent component trigger re-renders in the child component, but changes in the child component do not affect the parent or other components.