【发布时间】:2022-01-14 09:06:46
【问题描述】:
我知道simulate('click') 是用来测试点击组件的,但为什么不是simulate('onClick')?为什么它需要 'change' 而不是 'onChange'?
'click' 和 'change' 不是原生 html 事件。文档说它只需要一个 ol' 字符串。
/**
* Simulate events.
* Returns itself.
* @param args?
*/
simulate(event: string, ...args: any[]): this;
是否有类型列表可以作为事件参数接受哪种字符串的真实来源?
【问题讨论】:
标签: reactjs typescript enzyme