reading-notes

Course 301, Entry 1: Introduction to React and Components

Component-Based Architecture

A component is a piece of code, with its methods, events, and properties, which has well-defined uses which can be used and re-used in different areas of the total architecture.

Characteristics of Components:

  1. Independent - Functional with little to no dependencies.

  2. Not context specific - Can be used among many use cases.

  3. Encapsulated - Only shows interfaces, thus allowing code to be proprietary.

  4. Replaceable - Interchangeable with other components.

  5. Reusability - Can be used and reused in multiple different parts.

  6. Extensible - New capabilities being able to be added on.

Advantages

Ease to implement - Much like a car or bicycle, it’s always easier to replace things in parts.

Ease to develop - With pre-defined interfaces, it is much easier to design.

Reduced cost - No need to write code if it has been done before.

Reusable - Just as with cost, code that can be used in multiple areas is a good thing.

Modification of technical complexity - Modularity via parts.

Reliability - If the code worked previously in a similar use case, the bugs for the most part should be worked out.

System maintenance and evolution - Simplifies maintenance and update.

Independent - Parallel programming becomes much easier.

Introduction to Props, Using Props in React

“Props” is short for properties. These properties are used for transmitting data from one component to another. This flow is uni-directional and read-only.

Props are passed into components via a function argument.

Things I want to know more about

What are the best React libraries? Do we not need to worry about innerHTML if we use JSX?