1 | import React from "react";
|
2 |
|
3 | class Lifecycle extends React.Component {
|
4 | componentDidMount() {
|
5 | if (this.props.onMount) this.props.onMount.call(this, this);
|
6 | }
|
7 |
|
8 | componentDidUpdate(prevProps) {
|
9 | if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
|
10 | }
|
11 |
|
12 | componentWillUnmount() {
|
13 | if (this.props.onUnmount) this.props.onUnmount.call(this, this);
|
14 | }
|
15 |
|
16 | render() {
|
17 | return null;
|
18 | }
|
19 | }
|
20 |
|
21 | export default Lifecycle;
|