File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,15 @@ UIManager.genericDirectEventTypes = {
4343 ...customGHEventsConfig ,
4444} ;
4545// In newer versions of RN the `genericDirectEventTypes` is located in the object
46- // returned by UIManager.getViewManagerConfig('getConstants'), we need to add it there as well to make
46+ // returned by UIManager.getViewManagerConfig('getConstants') or in older RN UIManager.getConstants() , we need to add it there as well to make
4747// it compatible with RN 61+
48- if ( UIManager . getViewManagerConfig ) {
49- UIManager . getViewManagerConfig ( 'getConstants' ) . genericDirectEventTypes = {
50- ...UIManager . getViewManagerConfig ( 'getConstants' ) . genericDirectEventTypes ,
48+ const UIManagerConstants =
49+ UIManager . getViewManagerConfig ?.( 'getConstants' ) ??
50+ UIManager . getConstants ?.( ) ;
51+
52+ if ( UIManagerConstants ) {
53+ UIManagerConstants . genericDirectEventTypes = {
54+ ...UIManagerConstants . genericDirectEventTypes ,
5155 ...customGHEventsConfig ,
5256 } ;
5357}
You can’t perform that action at this time.
0 commit comments