View on GitHub

reading-notes

Reading

Component-Based Architecture

What is a “component”?

A component is a reusable piece of code, either a function or a class property, that can be added and used throughout an application.

What are the characteristics of a component?

Components are independent and reusable. They can handle state and be exported and included in the React app.

What are the advantages of using component-based architecture?

Using component-based architecture keeps the code organized and allows props to be based on parent and child components. It also provides for two-way binding to pass function parameters from child to parent elements.

What is Props and How to Use it in React

What is “props” short for?

“Props” is short for properties.

How are props used in React?

Props are assigned to an element in a parent element (where the child element is included and called). They are assigned like a typical HTML attribute but with a custom name. Data and variables can be passed into the props and read in the child element.

What is the flow of props?

The flow of props is unilateral from the parent to the child element.

Bookmark and Review