How it works...

As you can see, you have two options to bind methods in your React components. The constructor option is most commonly used at the moment, but the arrow functions are getting more popular. You decide which binding option you like the most.

Get React Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.