React开发onChange事件提示 use event.persist()错误

2020-04-23530次阅读React

React开发onChange事件提示 use event.persist()错误

This synthetic event is reused for performance reasons. If you’re seeing this, you’re accessing the property target on a released/nullified synthetic event. This is set to null. If you must keep the original synthetic event around, use event.persist(). See https://fb.me/react-event-pooling for more information.

解决方法:根据提示在操作event之前,先写如下语句:

e.persist();

 

上一篇: npx create-react-app my-app创建项目没有src以及public文件夹  下一篇: CSS3彩色进度条加载动画 带进度百分比  

React开发onChange事件提示 use event.persist()错误相关文章