3 ms·
Use one of the community-built subclasses of React.Component that provide auto-binding, like https://github.com/philpl/react-compat-component https://github.com
by acemarke 11y ago
Use one of the community-built subclasses of React.Component that provide auto-binding, like https://github.com/philpl/react-compat-component https://github.com/philpl/react-compat-component, or a utility function that's a one-line call like https://github.com/cassiozen/React-autobind https://github.com/cassiozen/React-autobind.