- state: SearchInputState = {
- value: ""
- };
-
- timeout: number;
-
- render() {
- const { classes } = this.props;
- return <form onSubmit={this.handleSubmit}>
- <FormControl>
- <InputLabel>Search</InputLabel>
- <Input
- type="text"
- value={this.state.value}
- onChange={this.handleChange}
- endAdornment={
- <InputAdornment position="end">
- <IconButton
- onClick={this.handleSubmit}>
- <SearchIcon />
- </IconButton>
- </InputAdornment>
- } />
- </FormControl>
- </form>;
- }
-
- componentDidMount() {
- this.setState({ value: this.props.value });
- }
-
- componentWillReceiveProps(nextProps: SearchInputProps) {
- if (nextProps.value !== this.props.value) {
- this.setState({ value: nextProps.value });