cartant/ts-action

ts-action library requires polyfill on React Native Android

lnhrdt opened this issue · 3 comments

I'm building a react-native app and using your ts-action library. Thanks, it's neat.

I've noticed that instantiating an action (calling the constructor on an ActionCtor type) throws an error on Android. I get undefined is not a function (evaluating 'Object.setPrototypeOf(_this, literalPrototype)'). On iOS the code works fine.

Also, adding a polyfill for setPrototypeOf to my application (like MDN's polyfill) fixes the problem.

I'm not sure the best way to address this, or if it's even the responsibility of this library to care about usage on react-native Android, but thought I'd report it and start a discussion.

Thanks for raising the issue. The polyfill is so simple that I think the best solution is to include it in the library as a ponyfill. I'll add it to my list of things to do.

This should be fixed in 6.0.2 which has just been published. The MDN polyfill is now included (as a ponyfill).

Confirming that 6.0.2 doesn't require a polyfill anymore on Android and it's fixed. Thanks for the fast response!