Skip to content

Instantly share code, notes, and snippets.

@dabbott
Created September 18, 2016 16:08
Show Gist options
  • Save dabbott/9a2849de563cc6f402a2d0e5a8a39bde to your computer and use it in GitHub Desktop.
Save dabbott/9a2849de563cc6f402a2d0e5a8a39bde to your computer and use it in GitHub Desktop.
import { AppRegistry } from 'react-native'
let entry = require('actual-entry-file.js')
// Check if we're dealing with ES6-style imports
if (typeof entry === 'object' && entry !== null && entry._esModule) {
// If we are, pick the default import
entry = entry.default
}
if (typeof entry === 'function') {
AppRegistry.registerComponent(() => entry)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment