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:
Independent - Functional with little to no dependencies.
Not context specific - Can be used among many use cases.
Encapsulated - Only shows interfaces, thus allowing code to be proprietary.
Replaceable - Interchangeable with other components.
Reusability - Can be used and reused in multiple different parts.
Extensible - New capabilities being able to be added on.
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.
“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.
What are the best React libraries? Do we not need to worry about innerHTML if we use JSX?