Passing Functions as Props
React Docs - list and keys
- a new array that uses the results from called fucntion on every element in the called array
- {}
- Key
- Help react identify changes. Giving a stable identity
The spread Operator
- Syntax used for arrays to add items, combine diffrent arrays or objexcts, or spreading array into functions arguments
- Combinnig objects, converting NodeList to an array, adding an item to a list, using math functions
- Combining two diffrent arrays of fruits and bananas so that a dev can use the whole array together
-
Video: How to pass functions between Components
- let color = {red}
- let name = {apple}
- let fruit = {red, apple}
- In the video, what is the first step that the developer does to pass functions between components?
- In your own words, what does the increment function do?
- How can you pass a method from a parent component into a child component?
- How does the child component invoke a method that was passed to it from a parent component?
CITE
- List and Keys (https://reactjs.org/docs/lists-and-keys.html)
- How to Use the Spread Operator… (https://medium.com/coding-at-dawn/how-to-use-the-spread-operator-in-javascript-b9e4a8b06fab)
- React- How to pass functions between components- episode 22 (https://www.youtube.com/watch?v=c05OL7XbwXU)