reading_notes

Read: Class 05 - Thinking in React:

React - Paradox Statement

Thinking in React

1. How would you break a mock into a component heirarchy?

2. What is the single responsibility principle and how does it apply to components?

A computer-programming principle that states that every module, class or function in a computer program should have responsibility over a single part of that program’s functionality, and it should encapsulate that part. All of that module, class or function’s services should be narrowly aligned with that responsibility.

Example:

Component Hierarchy

  1. FilterableProductTable (orange): contains the entirety of the example
  2. SearchBar (blue): receives all user input
  3. ProductTable (green): displays & filter the data collection based on user input
  4. ProductCategoryRow (turquoise): displays a heading for each category
  5. ProductRow (red): displays a row for each product

3. What does it mean to build a ‘static’ version of your application?

It means to build a version of the app that takes your data model and renders the UI but, has no interactivity using props without using state.

4. Once you have a static application, what do you need to add?

make the UI interactive. and this can be done by using the state to trigger changes.

5. What are the three questions you can ask to determine if something is state?

if the answer of any of these questions: yes, so it’s not state.

6. How can you identify where state needs to live?

Component Life Cycle


Things I want to know more about

Go deeply into component Hierarchy, Paradox Statement and Component Life Cycle Today the subject “Thinking in React” and all content is important and need to explore.