Inferno: LinkEvent vs. bind(this) for forms.

Created on 26 Dec 2017  路  2Comments  路  Source: infernojs/inferno

I have a simple question. I'm currently implementing a form. I realized that the documentation uses two ways of doing it.
Binding this into the scope of the function => https://infernojs.org/docs/guides/forms
and
Use linkEvent => https://github.com/infernojs/inferno/blob/master/README.md#linkevent-package-inferno

What do you generally prefer for forms? Generally I use everytime linkEvent. It's sometimes hard to find where the this comes from. Especially if you use many nested components.

question

Most helpful comment

linkEvent works very well together with functional Components, where you cannot bind function context to this. However with ES6 classes I think this is matter of taste

All 2 comments

linkEvent works very well together with functional Components, where you cannot bind function context to this. However with ES6 classes I think this is matter of taste

Closing this since I think @Havunen answered this pretty nicely.

Was this page helpful?
0 / 5 - 0 ratings