it would be best to first look at my code:
import React, { Component } from \'react\';
import _ from \'lodash\';
import Services from \'Services\'; // Webser
The problem occurs because you aren't calling the debounce function, you could do in the following manner
export default class componentName extends Component {
constructor(props) {
super(props);
this.state = {
value: this.props.value || null
}
this.servicesValue = _.debounce(this.servicesValue, 1000);
}
onChange(value) {
this.setState({ value });
this.servicesValue(value);
}
servicesValue = (value) => {
Services.setValue(value)
}
render() {
return (
this.onChange(value)}
value={this.state.value}
/>
)
}
}