0

Which is the common way to introduce a ref in React, and how will it differ with curly brackets, parentheses and without brackets?

Line 1:

buttonRef={n => {this.loadMoreBtn = n}}

Line 2:

buttonRef={n => (this.loadMoreBtn = n)}

Line: 3

buttonRef={n => this.loadMoreBtn = n}
Suren Srapyan
  • 62,337
  • 13
  • 111
  • 105
Thong Yi Xuen
  • 651
  • 1
  • 6
  • 10

0 Answers0