@@ -160,16 +160,14 @@ function dispatchCommand(handle: any, command: string, args: Array<any>) {
160160 'native component. Use React.forwardRef to get access to the underlying native component' ,
161161 ) ;
162162 }
163-
164163 return ;
165164 }
166165
167- if ( handle . _internalInstanceHandle ) {
168- nativeFabricUIManager . dispatchCommand (
169- handle . _internalInstanceHandle . stateNode . node ,
170- command ,
171- args ,
172- ) ;
166+ if ( handle . _internalInstanceHandle != null ) {
167+ const { stateNode} = handle . _internalInstanceHandle ;
168+ if ( stateNode != null ) {
169+ nativeFabricUIManager . dispatchCommand ( stateNode . node , command , args ) ;
170+ }
173171 } else {
174172 UIManager . dispatchViewManagerCommand ( handle . _nativeTag , command , args ) ;
175173 }
@@ -186,11 +184,11 @@ function sendAccessibilityEvent(handle: any, eventType: string) {
186184 return ;
187185 }
188186
189- if ( handle . _internalInstanceHandle ) {
190- nativeFabricUIManager . sendAccessibilityEvent (
191- handle . _internalInstanceHandle . stateNode . node ,
192- eventType ,
193- ) ;
187+ if ( handle . _internalInstanceHandle != null ) {
188+ const { stateNode } = handle . _internalInstanceHandle ;
189+ if ( stateNode != null ) {
190+ nativeFabricUIManager . sendAccessibilityEvent ( stateNode . node , eventType ) ;
191+ }
194192 } else {
195193 legacySendAccessibilityEvent ( handle . _nativeTag , eventType ) ;
196194 }
0 commit comments