Skip to content

urrri/hands-on-react

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HANDS-ON REACT

git checkout step4

Step 4

  • using Life-cycle events

Step 4.A

Searching books

  • Find filter state inside App component - it reflects search string from Header
  • Pass it to the Bookshelf

In the Bookshelf we need to filter books list, but doing it in the render is huge overhead.

For this purpose exists componentWillReceiveProps lyfe-cycle event.

  • Initialize state for Bookshelf with books (constructor, props; see App.js)
  • Override componentWillReceiveProps for Bookshelf and filter received books with received filter. Put results to state (You don't need to use setState)

Finally typing text in search field should filter books

####step 1

  • making a react simple component
  • making a react component
  • jsx basics
  • components props

####step 2

  • component lists
  • props validation
  • using dynamic class

####step 3

  • using events
  • using component state
  • using dynamic local style

About

React Hands-on project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published