reading-notes

Think you might be in the wrong place? Go home!

What is a “component”?

A “component” refers to a modular, self-contained, and reusable unit of software that encapsulates a set of related functionalities. Components are designed to be easily integrated into larger systems or applications.

What are the characteristics of a component?

What are the advantages of using component-based architecture?

What is “props” short for?

In React, “props” is short for “properties.” Props are a mechanism for passing data from a parent component to a child component. They allow you to pass values, functions, or objects from one component to another.

How are props used in React?

Passing Props:

In a parent component, you can pass data to a child component by including attributes in the child component’s JSX. These attributes are known as props.

Example: <ChildComponent propName={propValue} />

Receiving Props:

In the child component, you can access the passed props through the props object.

Example: const propValue = this.props.propName;

Using Props:

Once received, props can be used in the child component like regular variables.

Example: <p>{propValue}</p>

What is the flow of props?

Information gathered using ChatGPT