import * as React from "react" ; import { TextField } from "office-ui-fabric-react/lib/TextField" ; import * as telemetry from '../../common/telemetry' ; import { IPropertyFieldPasswordHostProps , IPropertyFieldPasswordHostState } from "./IPropertyFieldPasswordHost" ; export default class PropertyFieldPasswordHost extends React . Component < IPropertyFieldPasswordHostProps , IPropertyFieldPasswordHostState > { constructor ( props ) { super ( props ) ; telemetry . track ( 'PropertyFieldPassword' , { } ) ; this . state = { value : this . props . value } ; } public componentDidUpdate ( prevProps , prevState ) { if ( prevProps . value !== this . props . value ) { this . setState ( { value : this . props . value } ) ; } } public render ( ) { return ( < div > < TextField type = "password" label = { this . props . label ? this . props . label : null } value = { this . state . value } onChange = { ( e , newValue ) => { this . setState ( { value : newValue } ) ; this . props . onChanged ( newValue ) ; } } /> < /div>); } }