I am using inline arrow function to change the onClick
handlers of some divs in my React component, but I know it is not a good way in terms of performance.
#1 is fine.
#2 is also 'fine', but you need to pass props, then the render function will look exactly like #1. You will be calling the bind
'd function, because you replaced it in the constructor.
#3 is just wrong, as the function gets called during render.
And regarding #4, from react docs
We generally recommend binding in the constructor or using the class fields syntax, to avoid this sort of performance problem.
This causes a performance penalty when your function is used in its child components and will cause the child components to re-render (its not in your case). So you shouldn't do #4.