import React from 'react'; import { LocalizerType } from '../../types/Util'; import classNames from 'classnames'; interface Props { i18n: LocalizerType; label: string; type: string; placeholder: string; enableShowHide?: boolean; } interface State { inputValue: string; forceShow: boolean; } export class SessionInput extends React.PureComponent { constructor(props: any) { super(props); this.updateInputValue = this.updateInputValue.bind(this); this.state = { inputValue: '', forceShow: false, }; } public render() { const { placeholder, type, label, enableShowHide } = this.props; const { inputValue, forceShow } = this.state; const correctType = forceShow ? 'text' : type; return (
{ this.updateInputValue(e); }} onChange={e => { this.updateInputValue(e); }} />
); } private updateInputValue(e: any) { this.setState({ inputValue: e.target.value, }); e.preventDefault(); } }