The single responsibility principle, when applied to components, means that a component should only do one thing.
A static version just renders the UI without any interactivity. They have componenets that reuse other components and pass data via props.
State
Something is state if it:
-
Changes over time
-
Isn't passed in from a parent via props
-
Can't be computed based on existing state or props
Identify all of the componenets that render something based on that state, and find their closest common parent component.
A higher-order function is a function that operates on another function, either by taking them as arguments or returning them.
Q7 Explore the greaterThan function as defined in the reading. In your own words, what is line 2 of this function doing?
The second line of the function returns a new function. That new function takes the original value, n, and compares it to the new value, m, passed into the new function. It will return true if m > n.
'Map' is a higher order function that takes in both an array and a callback function as arguements. It returns a new array, that is the same length as the original array, that is populated by the result of applying the callback function on each element of the array.
How to break up a mockup into components. I followed along with the example, but I feel like I would quickly get confused trying to do it myself.