什么时候使用类组件( Class Component)?什么时候使用功能组件(Functional Component)?

如果组件具有状态( state)或生命周期方法,请使用类组件;否则,使用功能组件。

发表评论