Skip to content

Daisyliu6/keeper-app-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keeper-app-react

  • Basicially the same like todolist app
  • There are two main components: CreateArea, Note

CreateArea Component

  • In the create area, need to type in title and content; create a const with useState to set the initial object with empty title and empty content
  • Input onchange to track the state changes
  • Pass the new note back to the App using the Add button function onClick
  • Inside form when submit the page will refresh; event.preventDefault() to prevent the page refresh
  • App component define a function to add the new note to an array

Note Component

  • Callback from the Note component to trigger a delete function
  • Use the filter function to filter out the item that needs deletion using index