最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

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

Preact crifan 1461浏览 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.171 seconds, using 22.08MB memory