title: babel-preset-react-native and higher order components
body: <p>I have just updated a project from RN 53 to 56, which means that babel also has been updated from version 6 to 7, which is causing me an issue which I can't really make sense of.</p>
  
  <p>It appears that classes extended inside a function retains only the class they extends, but not the extentions. The new constructor appears to be run though.</p>
  
  <p>The issue seams to be caused by <code>babel-preset-react-native@5.0.2</code></p>
  
  <p>To reproduce the issue, I have tried to generate a small example where i create and return a class inside a function</p>
  
  <pre><code>class A {
    a() {
      return 'a';
    }
  }
  
  const createB = () =&gt; {
    class B extends A {
      constructor() {
        super();
        this.c = 'c';
      }
  
      b() {
        return 'b';
      }
    }
  
    return B;
  }
  
  const CB = createB();
  
  console.log('a: ', typeof new CB().a);
  console.log('b: ', typeof new CB().b);
  console.log('c: ', typeof new CB().c);
  </code></pre>
  
  <p>If i run this as <code>yarn babel-node --presets=react-native index.js</code> <code>new CB().b</code> never gets defined</p>
  
  <pre><code>a:  function
  b:  undefined
  c:  string
  </code></pre>
  
  <p>If i instead run it without preset or <code>@babel/preset-env</code> it behaves as I expect.</p>
  
  <pre><code>a:  function
  b:  function
  c:  string
  </code></pre>
  
  <p>Anyone who has experience similar problems? I can solve it by loading <code>react-native</code> and then <code>@babel/preset-env</code>, but this causes some other issues from modules which uses class properties, which means that i need <code>@babel/preset-env</code> before <code>react-native</code></p>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>{
    "name": "err",
    "version": "1.0.0",
    "devDependencies": {
      "@babel/cli": "^7.0.0-beta.55",
      "@babel/core": "^7.0.0-beta.55",
      "@babel/node": "^7.0.0-beta.55",
      "@babel/preset-env": "^7.0.0-beta.55",
      "babel-preset-react-native": "^5.0.2"
    }
  }
  </code></pre>