diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java b/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java index df72df03f9..31e6dea1f6 100644 --- a/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java +++ b/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java @@ -7,6 +7,7 @@ import android.os.Bundle; import android.view.MotionEvent; import android.view.View; +import android.view.ViewGroup; import android.widget.FrameLayout; import androidx.annotation.RestrictTo; @@ -71,7 +72,7 @@ public void destroy() { } public void sendComponentWillStart(ComponentType type) { - this.post(()->{ + this.post(() -> { ReactContext currentReactContext = getReactContext(); if (currentReactContext != null) new EventEmitter(currentReactContext).emitComponentWillAppear(componentId, componentName, type); @@ -79,7 +80,7 @@ public void sendComponentWillStart(ComponentType type) { } public void sendComponentStart(ComponentType type) { - this.post(()->{ + this.post(() -> { ReactContext currentReactContext = getReactContext(); if (currentReactContext != null) { new EventEmitter(currentReactContext).emitComponentDidAppear(componentId, componentName, type); @@ -117,7 +118,12 @@ public void dispatchTouchEventToJs(MotionEvent event) { @Override public boolean isRendered() { - return getChildCount() >= 1; + ViewGroup view = reactSurface.getView(); + if (view != null) { + return view.getChildCount() >= 1; + } + + return false; } public EventDispatcher getEventDispatcher() { @@ -131,7 +137,7 @@ public String getComponentName() { } private ReactHost getReactHost() { - return ((ReactApplication)getContext().getApplicationContext()).getReactHost(); + return ((ReactApplication) getContext().getApplicationContext()).getReactHost(); } private ReactContext getReactContext() { diff --git a/package-lock.json b/package-lock.json index 9c68472b3e..74519358b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-navigation", - "version": "8.3.2", + "version": "8.4.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-native-navigation", - "version": "8.3.2", + "version": "8.4.2", "license": "MIT", "dependencies": { "hoist-non-react-statics": "3.x.x", @@ -15475,7 +15475,7 @@ }, "node_modules/npm/node_modules/lodash._baseindexof": { "version": "3.1.0", - "extraneous": true, + "dev": true, "inBundle": true, "license": "MIT" }, @@ -15491,19 +15491,19 @@ }, "node_modules/npm/node_modules/lodash._bindcallback": { "version": "3.0.1", - "extraneous": true, + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/lodash._cacheindexof": { "version": "3.0.2", - "extraneous": true, + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/lodash._createcache": { "version": "3.1.2", - "extraneous": true, + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -15518,7 +15518,7 @@ }, "node_modules/npm/node_modules/lodash._getnative": { "version": "3.9.1", - "extraneous": true, + "dev": true, "inBundle": true, "license": "MIT" }, @@ -15536,7 +15536,7 @@ }, "node_modules/npm/node_modules/lodash.restparam": { "version": "3.6.1", - "extraneous": true, + "dev": true, "inBundle": true, "license": "MIT" },