You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
1.1 KiB
19 lines
1.1 KiB
7 years ago
|
# Lifecycle Methods
|
||
|
|
||
|
Pillar provides exact same lifecycle methods as
|
||
|
[React](https://reactjs.org/docs/react-component.html#the-component-lifecycle):
|
||
|
|
||
|
| Method Name | When is it called? |
|
||
|
| --------------------------- | ----------------------------------------------------------- |
|
||
|
| `componentWillMount` | Before the component gets mounted to the DOM |
|
||
|
| `componentDidMount` | After the component gets mounted to the DOM |
|
||
|
| `componentWillUnmount` | Before component is removed from the DOM |
|
||
|
| `componentWillReceiveProps` | Before new props are accepted |
|
||
|
| `shouldComponentUpdate` | Before render() is called. Return `false` to prevent render |
|
||
|
| `componentWillUpdate` | Before render() |
|
||
|
| `componentDidUpdate` | After render() |
|
||
|
|
||
|
_**Note:** Lifecycle methods don't work in stateless components and string/template tag render._
|
||
|
|
||
|
**_Next: [Render from string →](./2_STRING_RENDER.html)_**
|