ueno-llc / react-native-starter

Professional react-native starter kit with everything you'll ever need to deploy rock solid apps
https://ueno-llc.github.io/react-native-starter
MIT License
574 stars 90 forks source link

@obsverable makes the starter kit crash #190

Closed jeremybarbet closed 5 years ago

jeremybarbet commented 5 years ago

Describe the bug Using the @observable decorator, makes the starter kit crashes on release mode only. It works when we are in debug mode.

The problem came from the last update of React-native 0.56.0 where they introduced the new babel@7 into the core of the framework. It's a matter of babel-helpers that are not imported into react-native and makes it crashs. You can follow the issue here https://github.com/facebook/react-native/issues/20150

To Reproduce

export default class Home extends React.Component<IReactNavigation> {

+ @observable
+ isLoaded = false;

static get options() {
  return {
    topBar: {
      title: {
        text: 'Home',
      },
    },
  };
}

Screenshots

2018-09-28 10:47:56.703 react-native-starter[25023:6977768] [error][tid:com.facebook.react.JavaScript] babelHelpers.applyDecoratedDescriptor is not a function. (In 'babelHelpers.applyDecoratedDescriptor(n.prototype,"isLoaded",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}})', 'babelHelpers.applyDecoratedDescriptor' is undefined)

Environment

jeremybarbet commented 5 years ago

A workaround has been pushed https://github.com/ueno-llc/react-native-starter/commit/30c5e9e47563aa1034abb76885f3c1fe97a1aa85 We will remove it as soon as Metro is updated

jeremybarbet commented 5 years ago

Fixed with RN 0.57.2 a29e8666a9246a622044ced8b34970e0a84bb40e