Open deepakgsrn opened 3 years ago
Sections in Part 2 - Communicating with server
Learning outcome : To get familiar with rendering the collection of data dynamically, submitting data using forms, fetching, handling & altering data in the backend server, adding styles to the react application
Rendering a collection, modules - 2h
Take Away's :
map
function can be used generate react elements from array of elementskey
attribute [eg. <li key={note.id}>{note.content}</li>
] which is used by react to determine how to update the view when re rendering. This key attribute should be unique & meaning full, Handling this with array indices may seem to work but could cause unintended side effects..map
creates a new array from the elements of the original array by transforming each entry using the callback function given as a parameter to the map
functionmap
function, the second parameter holds the index of that entry in the iteration .map((entry, index)
({notes})
import Note from './components/Note'
.js
can be omitted while importing the module. Forms - 3h
Take Away's :
Complete the part 2 of the course which walks through how to render a data collection, submitting data using HTML forms, using javascript code in browser to fetch, handle, alter data stored in the backend server and adding styles to react application