Well, I wrote like this and it works.(好吧,我这样写,而且行得通。)
handleStoreInput = (field: string) => (event: React.ChangeEvent<HTMLInputElement>) => {
this.setState({ [field]: event.target.value } as Pick<State, any>);
}
...
onChange={this.handleStoreInput('tableFilterMethod')}
By the way, any proper way to avoid using as any
?(顺便说一句,任何适当的方式,以避免使用as any
?) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…