re: React Beginner Question Thread ⚛ VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I tend to use class properties: class Button extends React.Component { handleClick = (e) => { // no binding } render() { return...
 

Although it looks quite cool I'm really not at ease with class properties because of how they could be confusing, scope wise.

A fat-arrow function is supposed to be bound to the lexical scope in which it is defined and that is very much not the case here, which could lead to some confusions.

I don't know exactly where to stand :D

We’ve been using them in production at Facebook for about a year now, and haven’t seen much confusion in practice.

code of conduct - report abuse