Sfoglia il codice sorgente

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

Wim Goeman 7 anni fa
parent
commit
695f0263de
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4
    0
      src/Navigation.js

+ 4
- 0
src/Navigation.js Vedi 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 || {};