摘要: 生命周期 生命周期图例: 组件生命周期相关:(九个生命周期接口) 最初始: getDefaultProps getInitialState Mounting/组件挂载相关: componentWillMountcomponentDidMount Updating/组件更新相关: componentW 阅读全文
posted @ 2020-01-13 09:09 柴小智 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 一、状态 自己在组件内部定义的 作用:组件内部的状态重新更新时,可以控制组件内部重新渲染(不需要重新调取组件也可以重新渲染) import React from 'react'; class Clock extends React.Component{ constructor(){ super(); 阅读全文
posted @ 2020-01-13 08:34 柴小智 阅读(349) 评论(0) 推荐(0) 编辑