DEV Community

[Comment from a deleted post]
Collapse
 
pengeszikra profile image
Peter Vivo

JSX a little bit shorter:

export default ({title}) => <h1>{title}</h1>;
Enter fullscreen mode Exit fullscreen mode

Don't need two declaration to write one thing.

Collapse
 
fullstockdev profile image
The Full Stock Developer

This is fine if you don't use TypeScript ;)

Collapse
 
hanna profile image
Hanna

I don't personally like arrow functions for this sort of thing.

Collapse
 
pengeszikra profile image
Peter Vivo

Yes you right that is attitude depend. I use arrows most of times, speciel this cases:

const chunk = block => arr => Array(Math.ceil( arr.length / block))
  .fill()
  .map( (_,i) => arr.slice(i * block, i * block + block));

where I can use dependency injection with arrow functions chain.