Skip to content

Commit 28a04a3

Browse files
committed
[docs] Clear up “confusing arrows” example.
Closes airbnb#856.
1 parent a597da5 commit 28a04a3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,13 @@ Other Style Guides
912912
const itemHeight = (item) => item.height > 256 ? item.largeSize : item.smallSize;
913913

914914
// good
915-
const itemHeight = (item) => { return item.height > 256 ? item.largeSize : item.smallSize; };
915+
const itemHeight = item => (item.height > 256 ? item.largeSize : item.smallSize);
916+
917+
// good
918+
const itemHeight = (item) => {
919+
const { height, largeSize, smallSize } = item;
920+
return height > 256 ? largeSize : smallSize;
921+
};
916922
```
917923
918924
**[⬆ back to top](#table-of-contents)**

0 commit comments

Comments
 (0)