Browse Source

Add error when trying to load a component which was badly registered (#708)

Wim Goeman 7 years ago
parent
commit
695f0263de
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/Navigation.js

+ 4
- 0
src/Navigation.js View File

@@ -24,6 +24,10 @@ function registerComponent(screenID, generator, store = undefined, Provider = un
24 24
 function _registerComponentNoRedux(screenID, generator) {
25 25
   const generatorWrapper = function() {
26 26
     const InternalComponent = generator();
27
+    if (!InternalComponent) {
28
+      console.error(`Navigation: ${screenID} registration result is 'undefined'`);
29
+    }
30
+    
27 31
     return class extends Screen {
28 32
       static navigatorStyle = InternalComponent.navigatorStyle || {};
29 33
       static navigatorButtons = InternalComponent.navigatorButtons || {};