React JSX组件属性的完整列表

时间:2019-05-31 01:49:41

标签: reactjs

是否有某个特定网站包含所有JSX组件的属性的完整列表?

例如:<button>onClick等等。

2 个答案:

答案 0 :(得分:1)

  • React exposes list of different SyntheticEvents. You can read all about them here
  • Also react has all DOM properties and attributes but they are all should be camelCased. You can read more about that here.

Also be sure you actually understand difference between JS, onclick DOM handler, and React synthetic event onClick:

  1. JavaScript has nothing to do with DOM onclick handler. That API is given to JS by browsers but there are no mention about that handler in ES specification.
  2. React has its own synthetic events. They are a little bit different from DOM events. Main difference is that React tried to make them cross-browser.

答案 1 :(得分:-1)

如果我没记错的话,onClick是JavaScript固有的事件处理程序。至于“属性列表”,我将阅读React Docs here。通常,您为JSX组件制作自己的道具。