Closed danielkcz closed 8 years ago
Take a look at https://github.com/stampit-org/react-stamp/issues/33. Stamps aren't "suffering", their behaviour is by design.
Well I agree that for regular stamps it's good design, but for react stamps it's almost necessity regarding to its performance mentioned in linked issue. I would say that almost best approach would be using decorators, but those are still not ready, so guess initializer it is...thanks.
It's something that ES6 classes kinda suffer from that all methods you want to pass as a callback has to be manually bound to
this
. It seems to me that stamps kinda suffer same thing compared toReact.createClass
that is doing autobind.So I am wondering how to approach this in here. Manual bind in initializer or directly in callback seems just awkward to me. However full autobind might have some unwanted effects too with mixing various behavior to the stamp, some of those methods might want to keep their original context.