- 遅い
* propsによる受け渡しで目的を達成できないか検討する
https://facebook.github.io/react/blog/2016/07/13/mixins-considered-harmful.html
- class -- > className
- for --- > htmlFor
// デフォルト設定& propsによる上書き
<button {...defualtAtts} {...this.props} >
{this.props.children}
<\button>
- ブラウザによる通常のHTMLのサブミット処理が実行されないようにしている。
- ブラウザによる標準的な処理では、フォームに関わるU/Iが強制的にリセットされることによりonHandleSubmit()の中でValidationの結果に応じた処理を実行しても意味がなくなる。
onHandleSubmit: function(event) {
event.preventDefault();
}
<form
onChange={this.onHandleChange}
>
<input
onSubmit={this.onHandleSubmit}
/>
</form>
- Virual DOM から DOMへ部分的な変更をする際に必要。
- 変更部分を一意に特定し、最低限の変更操作で済むようにするために必要。
- もし指定しない場合は、警告が出る * よい広域のDOMが更新対象になるためrender負荷が増えてしまう。そのため省略するメリットはない。
- Perf
- TestUtils
- ReactTransitionGroup
- ReactCSSTransitionGroup
add-on | URL |
---|---|
material-ui | http://www.material-ui.com/ |
grommet | https://grommet.github.io/ |
Belle | http://nikgraf.github.io/belle/ |
React-Bootstrap | https://react-bootstrap.github.io/ |
Elemental UI | http://elemental-ui.com/ |
Semantic UI | http://semantic-ui.com/ |