GoScrobble/web/node_modules/react-router/modules/Lifecycle.js

22 lines
445 B
JavaScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
import React from "react";
class Lifecycle extends React.Component {
componentDidMount() {
if (this.props.onMount) this.props.onMount.call(this, this);
}
componentDidUpdate(prevProps) {
if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
}
componentWillUnmount() {
if (this.props.onUnmount) this.props.onUnmount.call(this, this);
}
render() {
return null;
}
}
export default Lifecycle;