reading-notes

Code-Fellows reading notes.

View the Project on GitHub bkasprzyk19/reading-notes

<==Back

React Docs - Thinking in React

A component should ideally only do one thing. If it ends up growing it needs to be ‘decomposed’ into smaller subcomponents.

A version without any interactivity so as to show the data model and render the UI

Functionality and interactivity.

Is it passed in from a parent via props? Does it remain unchanged over time? Can you compute it based on any other state or props in your component?

Which component owns the state. Identify which components render somethings based on the state. Find the common owner component. Either a common owner or another component higher up should own the state. You can also create a new component solely for holding the state.

https://reactjs.org/docs/thinking-in-react.html

Higher-Order Functions

functions that operate on other functions, either by taking them as arguments or by returning them, are called higher-order functions.

returning a function that cehcks if the input value n is less than the initial input value m

https://eloquentjavascript.net/05_higher_order.html#h_xxCc98lOBK