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 #980
1 parent 9ffadff commit 52a2da4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)