What is the difference between componentWillMount and componentDidMount in ReactJS?

前端 未结 8 513
Happy的楠姐
Happy的楠姐 2020-11-29 20:05

I looked at Facebook\'s documentation at (React.Component) and it mentions how componentWillMount is invoked on the client/server whereas componentDidMou

8条回答
  •  佛祖请我去吃肉
    2020-11-29 20:35

    As per the documentation ( https://facebook.github.io/react/docs/react-component.html )

    Methods prefixed with will are called right before something happens and

    Methods prefixed with did are called right after something happens.

提交回复
热议问题