superdesk/superdesk-client-core

View on GitHub
scripts/apps/search/components/mount-tracker.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';

interface IProps {
    onDidMount?();
    onWillUnmount?(): void;
}

export class MountTracker extends React.Component<IProps> {
    componentDidMount() {
        this.props.onDidMount?.();
    }

    componentWillUnmount() {
        this.props.onWillUnmount?.();
    }

    render() {
        return this.props.children;
    }
}