O'Reilly logo

Mastering React by Ryan Vice, Adam Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Component lifecycle – updating events

There are also events that will allow us to execute code relative to when our component's state and properties get updated. To demonstrate this we will look at the sample application shown below:

Component lifecycle – updating events

This is an extremely contrived example that is intended to help us see updating events in action. This application has two buttons:

  • Like button: This button will increase the like count
  • Unlike button: This button will decrease the like count

The application also has the following features:

  • It displays a total count of likes
  • It has a GlyphIcon component that will show an up arrow if the like count is increasing or a down arrow ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required