javascript - 无法修复未捕获的类型错误:e.target 未定义
问题描述
在ReactJS我有一个component
如下
<AutoComplete
style={{ width: 400, fontSize: "13px" }}
placeholder="Search for a user"
options={this.getUserOptions()}
filterOption={true}
onSearch={this.handleUserSearch}
onSelect={this.onSelect}
/>
然后我在搜索中调用一个函数HandleUserSearch
:
handleUserSearch = (e) => {
const {value} = e.target
//do stuff here
}
但得到一个
未捕获的类型错误:e.target 是未定义的错误。
有人知道我在做什么错吗?
解决方案
推荐阅读
- mysql - 插件/预设文件不允许导出对象,只能导出功能。解析文件时在 index.js 中:App.js
- angular - 传递给 ngclass 枚举字符串值
- c++ - 如何使用 OpenGL 在屏幕上显示一个三角形?
- python - 使用 Python3 处理 Textarea 事件
- json - 如何索引包含稀疏填充的 geo_point 数据的嵌套 JSON?
- java - 为什么我不断收到此索引错误?
- uwp - UWP 应用程序的开发人员是否有任何 API?
- reactjs - dispatch thunk 返回到组件
- javascript - Puppeteer - 如何在具有类名的 div 中选择一个标签
- android - SymbolLayer 中的数据驱动图标大小