import * as React from "react" ; export abstract class ComponentCompat < T1 = { } , T2 = { } , SS = any > extends React . Component < T1 , T2 , SS > { private _hasRenderedOnce : boolean = false ; private _didPropsChange : boolean = false ; constructor ( props , context ? ) { super ( props , context ) ; } public shouldComponentUpdate ( newProps , newState ) { if ( this . props !== newProps ) { this . componentWillReceivePropsCompat ( newProps ) ; } return true ; } public componentWillReceivePropsCompat ( newProps ) { } public componentWillMountCompat ( ) { } public componentWillUpdateCompat ( ) { } public render ( ) { if ( ! this . _hasRenderedOnce ) { this . _hasRenderedOnce = true ; this . componentWillMountCompat ( ) ; } else { this . componentWillUpdateCompat ( ) ; } return this . renderCompat ( ) ; } public abstract renderCompat ( ) ; }