- How would you break a mock into a component heirarchy? it apply to components? The mock looks like this:
You shoud do: ✔ draw boxes around every component (and subcomponent) in the mock and give them all names.
following these five component italicized for data what each component represents.
-
FilterableProductTable (orange): contains the entirety of the example
-
SearchBar (blue): receives all user input
-
ProductTable (green): displays and filters the data collection based on user input
-
ProductCategoryRow (turquoise): displays a heading for each category
-
ProductRow (red): displays a row for each product
✔ then arrange identified component hierarchy:
-
FilterableProductTable
-
SearchBar
-
ProductTable
- ProductCategoryRow
- ProductRow
-
What is the single responsibility principle and how does ? ✔ that is, a component should ideally only do one thing. If it ends up growing, it should be decomposed into smaller subcomponents.
-
What does it mean to build a ‘static’ version of your application? ✔ To build a static version of your app that renders your data model, you’ll want to build components that reuse other components and pass data using props.
-
Once you have a static application, what do you need to add? ✔ need to add value
-
What are the three questions you can ask to determine if something is state?
-
Is it passed in from a parent via props? If so, it probably isn’t state.
-
Does it remain unchanged over time? If so, it probably isn’t state.
-
Can you compute it based on any other state or props in your component? If so, it isn’t state.