@@ -161,16 +161,14 @@ function dispatchCommand(handle: any, command: string, args: Array<any>) {
161161 'native component. Use React.forwardRef to get access to the underlying native component' ,
162162 ) ;
163163 }
164-
165164 return ;
166165 }
167166
168- if ( handle . _internalInstanceHandle ) {
169- nativeFabricUIManager . dispatchCommand (
170- handle . _internalInstanceHandle . stateNode . node ,
171- command ,
172- args ,
173- ) ;
167+ if ( handle . _internalInstanceHandle != null ) {
168+ const { stateNode} = handle . _internalInstanceHandle ;
169+ if ( stateNode != null ) {
170+ nativeFabricUIManager . dispatchCommand ( stateNode . node , command , args ) ;
171+ }
174172 } else {
175173 UIManager . dispatchViewManagerCommand ( handle . _nativeTag , command , args ) ;
176174 }
@@ -187,11 +185,11 @@ function sendAccessibilityEvent(handle: any, eventType: string) {
187185 return ;
188186 }
189187
190- if ( handle . _internalInstanceHandle ) {
191- nativeFabricUIManager . sendAccessibilityEvent (
192- handle . _internalInstanceHandle . stateNode . node ,
193- eventType ,
194- ) ;
188+ if ( handle . _internalInstanceHandle != null ) {
189+ const { stateNode } = handle . _internalInstanceHandle ;
190+ if ( stateNode != null ) {
191+ nativeFabricUIManager . sendAccessibilityEvent ( stateNode . node , eventType ) ;
192+ }
195193 } else {
196194 legacySendAccessibilityEvent ( handle . _nativeTag , eventType ) ;
197195 }
0 commit comments