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
  • 66,568
  • 14
  • 114
  • 112
Thong Yi Xuen
  • 1,001
  • 1
  • 9
  • 10

0 Answers0