
上QQ阅读APP看书,第一时间看更新
Creating a dynamic class component
However, our class component is still static. We are now going to add some state to our component. We start out by setting the initial state. Then, you will learn how to deal with side effects (such as timers or API requests) via React life cycle methods. Finally, you are going to learn how to update this.state with React, and thus create a dynamic component.