タイトルのコードは、Reactを勉強している時に見かけた文法
<input type="text" placeholder="TODOを入力..." ref={c => this.input = c} />
{c => this.input = c}
なんやねん、この記述!何を意味しとるかさっぱりわからん。
以下の説明を見つけて納得
// functionを使った書き方
function(c) {
this.input = c;
}
// アロー関数省略なし
(c) => {
this.input = c;
}
// 引数が1つの場合は()省略可
c => {
this.input = c;
}
// ブロックが一行の場合こういった書き方もする
c => this.input = c;
はえー、そういうことやったんか!