I study React Native faced with such a design I do not understand what it means

sectionHeaderHasChanged: (r1, r2) => r1 !== r2, 
  • 2
    Arrow functions - Mr. Brightside
  • @ Mr. Brightside so I understand this reduction yes? You can paint as it will be in an unabridged form - Anton Veselov
  • one
    in the abbreviated function (r1, r2) {r1! == r2}, however, the trick here in the arrow is the transfer of the context. If the function needs to refer to the parent context, then in the "unabridged" form, you will need to previously save the context in a variable, or zabindit it. In the case of an arrow function, the context inside the function can be passed simply => - Mr. Brightside
  • one
    @ Mr.Brightside, return forgot. Well, I think it is worth making your comment in the form of an answer. Maybe it will be useful to someone else - Dmitriy Simushev
  • one
    the question is not so much about the reaction as about ecmascript-6 . Worth To Check - Nofate

2 answers 2

These are arrow functions.

In the "normal" form, your construction will be as follows:

 function (r1, r2) { return r1 !== r2; } 

However, the trick here in the arrow is the transfer of context. If the function needs to refer to the parent context, then in the "unabridged" form, you will need to previously save the context in a variable, or zabindit it. In the case of an arrow function, the context inside the function can be transferred simply =>

Well, as you correctly wrote in the comments, the question is really about ES6

    If you do not understand the purpose of this method, then it says that in the generation of component elements, the generation will continue until the next element of the list is equal to the previous one.