最新消息:20210917 已从crifan.com换到crifan.org

【整理】preact的生命周期函数

Preact crifan 1136浏览 0评论

看到:

React Basics Ep. 4: React Basics – Calling an API – YouTube

-》

React Basics Ep. 3: React Basics – Lifecycle Methods – YouTube

preact Lifecycle Methods

生命周期方法 | Preact: Fast 3kb React alternative with the same ES6 API. Components & Virtual DOM.

preact componentWillMount example

Pre-Mounting with componentWillMount() · react-indepth

对于现有的代码:

export default class Main extends Component {

中间有:

constructor

render

之外,应该是:

自己添加对应的生命周期函数,比如:

componentWillMount

在里面写上网络调用的函数,就可以了。

转载请注明:在路上 » 【整理】preact的生命周期函数

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
94 queries in 0.187 seconds, using 23.31MB memory