Преглед на файлове

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

Wim Goeman преди 7 години
родител
ревизия
695f0263de
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4
    0
      src/Navigation.js

+ 4
- 0
src/Navigation.js Целия файл

@@ -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 || {};