Using constructor is not the old way, it's still a viable way to construct a state, and in the end this:
state = { value: "" }
is transpiled to this:
constructor(props) { super(props); this.state = { value: "" }; }
So. it's not the old way, it's just syntatic sugar.
Using arrow functions to bind methods to the class is really useful tho.
True story! :-) That is right! I meant "old way" and "new way" like... we "used that way" and we "should use this way". :-)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
Using constructor is not the old way, it's still a viable way to construct a state, and in the end this:
is transpiled to this:
So. it's not the old way, it's just syntatic sugar.
Using arrow functions to bind methods to the class is really useful tho.
True story! :-) That is right!
I meant "old way" and "new way" like... we "used that way" and we "should use this way". :-)