Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
In your "messy" example, I believe the code should be even messier. The bind won't mutate the original function, but will return a new and bound function. So you must also set this to overwrite the original function.
classSomeCompenentextendsReact.Component{constructor(){super();// this does not modify the original functionthis.renderSomeInput.bind(this);// this binds the original functionthis.renderSomeInput=this.renderSomeInput.bind(this);}}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In your "messy" example, I believe the code should be even messier. The
bind
won't mutate the original function, but will return a new and bound function. So you must also set this to overwrite the original function.