View on GitHub

reading-notes

Passing Functions as Props

Reading

What does .map() return?

An array.

 

Using .map(), we make every value in the array we are mapping go through html-like code we want it in.

 

Key.

 

Keys help React identify which items have changed, are added, or are removed.

 

he spread syntax “spreads” the array into separate arguments.

 

 

const hello = ['hello']
const world = ['world']

const helloWorld = [...hello,...world]
console.log(...helloWorld) // hello world

 

const fruit1  = ['apple', 'pineapple', 'banana']
const fruit2 = ['orange']

const fruits = [...fruit1,...fruit2]
console.log(...fruits) // apple pineapple banana orange

 

const hello = {hello: “hayoo”} const world = {world: “globe”}

const helloWorld = {…hello,…world} console.log(helloWorld) // Object { hello: “hayoo”, world: “globe” }

Videos

make a constructor.

 

Increase the number besides the names the instructor used.

 

By passing it as an attribute through the html-like code (example: increment={this.increment}).

 

You can call it through this.props.increment().





301 Home
read01 Introduction to React and Components
read02 State and Props
read03 Passing Functions as Props
read04 React and Forms
read05 Putting it all together
read06 NODE.JS
read07 REST
read08 APIs
read09 FUNCTIONAL PROGRAMMING
read10 In memory storage
read11 Authentication
read12 Mongo and Mongoose
read13 CRUD
read14 Project Ideas
read15 Project Kickoff