Use one of the community-built subclasses of React.Component that provide auto-binding, like <a href="https:&#x2F;&#x2F;github.com&#x2F;philpl&#x2F;react-compat-component" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;philpl&#x2F;react-compat-component</a>, or a utility function that&#x27;s a one-line call like <a href="https:&#x2F;&#x2F;github.com&#x2F;cassiozen&#x2F;React-autobind" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cassiozen&#x2F;React-autobind</a>.