import * as React from "react" ; import { TextField , Spinner , SpinnerSize } from "office-ui-fabric-react" ; import { IPropertyFieldSpinnerHostProps , IPropertyFieldSpinnerHostState } from "./IPropertyFieldSpinnerHost" ; import * as telemetry from '../../common/telemetry' ; export default class PropertyFieldSpinnerHost extends React . Component < IPropertyFieldSpinnerHostProps , IPropertyFieldSpinnerHostState > { constructor ( props ) { super ( props ) ; telemetry . track ( 'PropertyFieldSpinner' , { } ) ; this . state = { isVisible : this . props . isVisible } ; } public componentDidUpdate ( prevProps , prevState ) { if ( prevProps . isVisible !== this . props . isVisible ) { this . setState ( { isVisible : this . props . isVisible } ) ; } } public render ( ) { return ( < div > { this . props . isVisible && < Spinner className = { this . props . className } size = { this . props . size } label = { this . props . label } > < /Spinner>} < /div>); } }