--
btw, another issue you didn't mention in your article... events are often really problematic in VDOM
because in React, if you do something like this... <Foo onclick={(e) => { ... }} />
every time render is called, it will create a fresh new closure
that's already not great, but it gets even worse
because now React has to unbind the old onclick handler and add the new onclick handler
and it has to do this on every single render
which is why it's common practice to do things like this.onclick = this.onclick.bind(this);
so that way you can do <Foo onclick={this.onclick} />
so that way the closure doesn't change, so React doesn't have to update it
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.
A good note from Pauan:
--
btw, another issue you didn't mention in your article... events are often really problematic in VDOM
because in React, if you do something like this...
<Foo onclick={(e) => { ... }} />
every time render is called, it will create a fresh new closure
that's already not great, but it gets even worse
because now React has to unbind the old onclick handler and add the new onclick handler
and it has to do this on every single render
which is why it's common practice to do things like
this.onclick = this.onclick.bind(this);
so that way you can do
<Foo onclick={this.onclick} />
so that way the closure doesn't change, so React doesn't have to update it