Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React事件系统 #5

Open
blucechen opened this issue Aug 30, 2018 · 0 comments
Open

React事件系统 #5

blucechen opened this issue Aug 30, 2018 · 0 comments

Comments

@blucechen
Copy link
Owner

blucechen commented Aug 30, 2018

react事件系统采用合成事件实现

  • 事件系统正确类型定义
// MouseEvent只是React定义的一个类event.nativeEvent型而已,其与原生匹配
handleClick(event: React.MouseEvent<HTMLElement>) {}
  • 获取原生事件
event.nativeEvent
  • 释放合成事件的值
event.persist()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant