77import android .os .Bundle ;
88import android .view .MotionEvent ;
99import android .view .View ;
10+ import android .view .ViewGroup ;
1011import android .widget .FrameLayout ;
1112
1213import androidx .annotation .RestrictTo ;
@@ -71,15 +72,15 @@ public void destroy() {
7172 }
7273
7374 public void sendComponentWillStart (ComponentType type ) {
74- this .post (()-> {
75+ this .post (() -> {
7576 ReactContext currentReactContext = getReactContext ();
7677 if (currentReactContext != null )
7778 new EventEmitter (currentReactContext ).emitComponentWillAppear (componentId , componentName , type );
7879 });
7980 }
8081
8182 public void sendComponentStart (ComponentType type ) {
82- this .post (()-> {
83+ this .post (() -> {
8384 ReactContext currentReactContext = getReactContext ();
8485 if (currentReactContext != null ) {
8586 new EventEmitter (currentReactContext ).emitComponentDidAppear (componentId , componentName , type );
@@ -117,7 +118,12 @@ public void dispatchTouchEventToJs(MotionEvent event) {
117118
118119 @ Override
119120 public boolean isRendered () {
120- return getChildCount () >= 1 ;
121+ ViewGroup view = reactSurface .getView ();
122+ if (view != null ) {
123+ return view .getChildCount () >= 1 ;
124+ }
125+
126+ return false ;
121127 }
122128
123129 public EventDispatcher getEventDispatcher () {
@@ -131,7 +137,7 @@ public String getComponentName() {
131137 }
132138
133139 private ReactHost getReactHost () {
134- return ((ReactApplication )getContext ().getApplicationContext ()).getReactHost ();
140+ return ((ReactApplication ) getContext ().getApplicationContext ()).getReactHost ();
135141 }
136142
137143 private ReactContext getReactContext () {
0 commit comments