Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Anton Spirin Quote
this is a shorthand notation that can only be used with babel. Specifically, the transform-class-properties plugin. It is included in the stage-2, stage-1, stage-0 presses. So, if you use one of them, feel free to use it.
Recording:
class Parent extends Component { constructor(props) { super(props); this.state = { data: [] }; this.handler = this.handler.bind(this); } handler(e) { // do something } }
Similar:
class Parent extends Component { state = { data: [], }; handler = e => { // do something }; }
In React development, this is one of the standards.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question