Skip to content

Commit 52a2da4

Browse files
committed
Add curlies around ref function body
The example we have here uses an implicit return, which is forbidden when assigning. This triggers the no-return-assign rule. Fixes airbnb#980
1 parent 9ffadff commit 52a2da4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎react/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@
337337
338338
// good
339339
<Foo
340-
ref={(ref) => this.myRef = ref}
340+
ref={ref => { this.myRef = ref; }}
341341
/>
342342
```
343343

0 commit comments

Comments
 (0)