How To Use ES6 Arrow Functions With React Native

  • Function.prototype.bind is a means of enforcing execution context ( this keyword).
  • With the pattern, we use this.onPress’ bind function to generate a wrapper function.
  • We just learned that Function.prototype.bind creates wrapping functions as a means to force execution context.

Read the full article, click here.


@ModusJesus: “Using #ES6 with #ReactJS? Check out my article on using Class-level Arrow Fns: #JavaScript #reactnative #HTML5”


When producing React Native applications, you’ll often need to iterate over data to render components, where you’ll need to pass a function as a property for later execution. Think of a for example. We often implement this component so that users can interact with it. In lots of cases, each Row needs to be tappable, thus we must pass an onPress handler.


How To Use ES6 Arrow Functions With React Native