() => ()
is a one liner shorthand of () => { doSomething() OR return; }
.
Anyways, if you need more manipulations and need more than one line statement, you should go for () => {}
syntax otherwise you can use a shorthand syntax () => ()
The following are also treated as one line statement. But to use with () => ()
syntax, you need to rewrite it without return
statement,
// The below one line statement can be rewritten as below
if (true ) return something;
// rewritten of above one
() => ( a > b ? a : b)
// one line statement
if (true ) invoke(); // This will go like, () => (a ? a.invoke() : b.invoke())
// one line statement
for(var i in results) doSomething();
//And your jsx statement which can be tread as one liner
<Cell {...props}>
<a href="#">{data.getObjectAt(rowIndex)[col]}</a>
</Cell>