交互与动画
交互与动画
export default class LeashedOne extends React.Component {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.onChangeDebounce = _.debounce(
value => this.props.onChange(value),
300
);
}
onChange(e) {
this.onChangeDebounce(e.target.value);
}
render() {
return <input onChange={this.onChange} />;
}
}