-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
Description
First I'd like to just say that I like the new destructuring-assignment
rule because I think it enforces a lot more clarity and explicitness. However I'm having problems with it throwing errors inside of class properties.
class MyComponent extends React.Component {
state = {
value: this.props.defaultValue,
};
...
}
IMO this should be an exception and be totally valid or at least have the option to exclude it just from this use-case. I know that I could move it inside a constructor
and destructure it there but I'd rather not do that.
mrdaniellewis, Venugopal46, tobilen, dzok, daddyj and 11 more