Manage React Component State with Lifecycle Methods

Share this video with your friends

Send Tweet

The previous lesson introduced the React component lifecycle mounting and unmounting. In this lesson you will learn some simple uses for these hooks and how we can interact with state.

Yu-Shih
Yu-Shih
~ 10 years ago

Why do you store btnStyle directly on the object, instead of on the state?

Fareez
Fareez
~ 10 years ago

Hi, are these code examples supposed to be working with the latest version of react? none of the code samples are working for me.

Faria Chowdhury
Faria Chowdhury
~ 10 years ago

It's working for me, using react 0.13.2. Here is a working example of the above code: http://jsfiddle.net/faria/d0sycoxv/1/

bradwoods.io
bradwoods.io
~ 8 years ago

getting an error saying 'component's children should no be mutated'. in button...

Tony Brown
Tony Brown
~ 8 years ago

I really like the lessons, everything is becoming clear now.